Merge pull request #117 from libp2p/deps/transport-split

split tcp transports out of the base package
This commit is contained in:
Jeromy Johnson 2016-09-25 19:20:15 -07:00 committed by GitHub
commit 7590c56930
9 changed files with 32 additions and 25 deletions

View File

@ -5,9 +5,9 @@ import (
"fmt"
"os"
transport "github.com/ipfs/go-libp2p-transport"
ma "github.com/jbenet/go-multiaddr"
"github.com/libp2p/go-libp2p/p2p/net/swarm"
tcpt "github.com/libp2p/go-tcp-transport"
)
func fatal(i interface{}) {
@ -25,7 +25,7 @@ func main() {
s := swarm.NewBlankSwarm(context.Background(), "bob", nil, nil)
// Add a TCP transport to it
s.AddTransport(transport.NewTCPTransport())
s.AddTransport(tcpt.NewTCPTransport())
// Add an address to start listening on
err = s.AddListenAddr(laddr)

View File

@ -1,7 +1,7 @@
package meterconn
import (
transport "github.com/ipfs/go-libp2p-transport"
transport "github.com/libp2p/go-libp2p-transport"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
)

View File

@ -9,9 +9,9 @@ import (
ci "github.com/ipfs/go-libp2p-crypto"
lgbl "github.com/ipfs/go-libp2p-loggables"
peer "github.com/ipfs/go-libp2p-peer"
transport "github.com/ipfs/go-libp2p-transport"
ma "github.com/jbenet/go-multiaddr"
manet "github.com/jbenet/go-multiaddr-net"
transport "github.com/libp2p/go-libp2p-transport"
addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
msmux "github.com/whyrusleeping/go-multistream"
context "golang.org/x/net/context"

View File

@ -13,8 +13,9 @@ import (
ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer"
transport "github.com/ipfs/go-libp2p-transport"
transport "github.com/libp2p/go-libp2p-transport"
tu "github.com/libp2p/go-libp2p/testutil"
tcpt "github.com/libp2p/go-tcp-transport"
ma "github.com/jbenet/go-multiaddr"
msmux "github.com/whyrusleeping/go-multistream"
@ -63,7 +64,7 @@ func setupSingleConn(t *testing.T, ctx context.Context) (a, b Conn, p1, p2 tu.Pe
}
func Listen(ctx context.Context, addr ma.Multiaddr, local peer.ID, sk ic.PrivKey) (Listener, error) {
list, err := transport.NewTCPTransport().Listen(addr)
list, err := tcpt.NewTCPTransport().Listen(addr)
if err != nil {
return nil, err
}
@ -72,7 +73,7 @@ func Listen(ctx context.Context, addr ma.Multiaddr, local peer.ID, sk ic.PrivKey
}
func dialer(t *testing.T, a ma.Multiaddr) transport.Dialer {
tpt := transport.NewTCPTransport()
tpt := tcpt.NewTCPTransport()
tptd, err := tpt.Dialer(a)
if err != nil {
t.Fatal(err)

View File

@ -7,8 +7,8 @@ import (
ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer"
transport "github.com/ipfs/go-libp2p-transport"
ma "github.com/jbenet/go-multiaddr"
transport "github.com/libp2p/go-libp2p-transport"
filter "github.com/libp2p/go-libp2p/p2p/net/filter"
)

View File

@ -9,11 +9,11 @@ import (
ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer"
transport "github.com/ipfs/go-libp2p-transport"
ma "github.com/jbenet/go-multiaddr"
tec "github.com/jbenet/go-temp-err-catcher"
"github.com/jbenet/goprocess"
goprocessctx "github.com/jbenet/goprocess/context"
transport "github.com/libp2p/go-libp2p-transport"
filter "github.com/libp2p/go-libp2p/p2p/net/filter"
msmux "github.com/whyrusleeping/go-multistream"
context "golang.org/x/net/context"

View File

@ -21,13 +21,14 @@ import (
ci "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
transport "github.com/ipfs/go-libp2p-transport"
logging "github.com/ipfs/go-log"
ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream"
pst "github.com/jbenet/go-stream-muxer"
"github.com/jbenet/goprocess"
goprocessctx "github.com/jbenet/goprocess/context"
transport "github.com/libp2p/go-libp2p-transport"
tcpt "github.com/libp2p/go-tcp-transport"
psmss "github.com/whyrusleeping/go-smux-multistream"
spdy "github.com/whyrusleeping/go-smux-spdystream"
yamux "github.com/whyrusleeping/go-smux-yamux"
@ -124,8 +125,7 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
dialT: DialTimeout,
notifs: make(map[inet.Notifiee]ps.Notifiee),
transports: []transport.Transport{
transport.NewTCPTransport(),
transport.NewUtpTransport(),
tcpt.NewTCPTransport(),
new(ws.WebsocketTransport),
},
bwc: bwc,

View File

@ -4,9 +4,9 @@ import (
"fmt"
lgbl "github.com/ipfs/go-libp2p-loggables"
transport "github.com/ipfs/go-libp2p-transport"
ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream"
transport "github.com/libp2p/go-libp2p-transport"
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"

View File

@ -59,9 +59,9 @@
"version": "1.2.0"
},
{
"hash": "QmPpRcbNUXauP3zWZ1NJMLWpe4QnmEHrd2ba2D3yqWznw7",
"hash": "QmY83KqqnQ286ZWbV2x7ixpeemH3cBpk8R54egS619WYff",
"name": "go-multiaddr-net",
"version": "1.2.0"
"version": "1.3.0"
},
{
"hash": "QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku",
@ -152,12 +152,6 @@
"name": "go-libp2p-secio",
"version": "1.0.12"
},
{
"author": "whyrusleeping",
"hash": "Qmazcq5ZXnyP5smvUquM8dAro6ZAppExxyV7Z3URq3dzin",
"name": "go-libp2p-transport",
"version": "1.6.1"
},
{
"author": "whyrusleeping",
"hash": "QmSHTSkxXGQgaHWz91oZV3CDy3hmKmDgpjbYRT6niACG4E",
@ -178,15 +172,27 @@
},
{
"author": "whyrusleeping",
"hash": "QmdMfSLMDBDYhtc4oF3NYGCZr5dy4wQb6Ji26N4D4mdxa2",
"hash": "QmYkwVGkwoPbMVQEbf6LonZg4SsCxGP3H7PBEtdNCNRyxD",
"name": "go-libp2p-peerstore",
"version": "1.2.4"
"version": "1.2.5"
},
{
"author": "whyrusleeping",
"hash": "QmWEQk3Ak32B2nAVjAnXzAsfXGHCyjvrHB9vroooWhEr8j",
"hash": "QmNvbe83jVfR13jAHpmEzrV21YJ1QRrRWJh6Vw9uBDaQdS",
"name": "ws-transport",
"version": "1.2.2"
"version": "1.3.0"
},
{
"author": "whyrusleeping",
"hash": "QmUDjsP471mkH5F4DoD5jQaTybX7ENU6YDULwQi9Keu3Vi",
"name": "go-libp2p-transport",
"version": "2.1.2"
},
{
"author": "whyrusleeping",
"hash": "QmXHZVjWjAgLXTBrH9LZ3u1VRiQBsmaPnd8ZWJG8jTTQNC",
"name": "go-tcp-transport",
"version": "1.0.1"
}
],
"gxVersion": "0.4.0",