This commit is contained in:
David Dias 2016-03-15 09:57:06 +00:00
parent 4036ea4b1a
commit b83e5dd8dc
3 changed files with 5 additions and 3 deletions

View File

@ -33,9 +33,9 @@
"chai": "^3.5.0",
"istanbul": "^0.4.2",
"libp2p-spdy": "^0.2.3",
"libp2p-tcp": "^0.3.0",
"libp2p-tcp": "^0.4.0",
"mocha": "^2.4.5",
"multiaddr": "^1.1.1",
"multiaddr": "^1.3.0",
"peer-id": "^0.6.0",
"peer-info": "^0.6.0",
"pre-commit": "^1.1.2",

View File

@ -41,7 +41,8 @@ function Swarm (peerInfo) {
multiaddrs = [multiaddrs]
}
// TODO a) filter the multiaddrs that are actually valid for this transport (use a func from the transport itself) (maybe even make the transport do that)
// a) filter the multiaddrs that are actually valid for this transport (use a func from the transport itself) (maybe even make the transport do that)
multiaddrs = t.filter(multiaddrs)
// b) if multiaddrs.length = 1, return the conn from the
// transport, otherwise, create a passthrough

View File

@ -77,6 +77,7 @@ describe('transport - tcp', function () {
it('dial to set of multiaddr, only one is available', (done) => {
const conn = swarmA.transport.dial('tcp', [
multiaddr('/ip4/127.0.0.1/tcp/9910/websockets'), // not valid on purpose
multiaddr('/ip4/127.0.0.1/tcp/9910'),
multiaddr('/ip4/127.0.0.1/tcp/9999'),
multiaddr('/ip4/127.0.0.1/tcp/9309')