32 Commits

Author SHA1 Message Date
David Dias
789fdcfdc3 merge #11 2015-09-28 16:11:16 +01:00
David Dias
81c6ab013d Merge pull request #14 from masylum/implement-close
Implemented `close` and improved the tests with it
2015-09-28 04:00:12 +01:00
Pau Ramon Revilla
5c53540e92 Implemented close and improved the tests with it 2015-09-26 20:12:13 +02:00
Pau Ramon Revilla
8dc46da80f Protect from peers without supported transports
# What

Trying to run compliance tests from the kad router module. I've tried to port the new swarm API but forgot to add a transport. The tests ended up blowing up instead of failing gracefully.

# How to test

```js
peerOne = new Peer(Id.create(), [multiaddr('/ip4/127.0.0.1/tcp/8090')])
peerTwo = new Peer(Id.create(), [multiaddr('/ip4/127.0.0.1/tcp/8091')])
swarm = new Swarm(peerZero)
swarm.dial(peerTwo, {}, function (err) {
  console.log(err);
});
```

This just work and display the error.
2015-09-26 16:55:34 +02:00
Pau Ramon Revilla
0514b0034b Do not allow undefined peerInfo
# What

The code assumes that `peerInfo` exists, the API doesn't.

# How to test

```js
swarm = new Swarm()
swarm.addTransport('tcp', tcp, { multiaddr: mh }, {}, {port: 8095})
```

This shouldn't explode because of `self.peerInfo.multiaddrs`.
2015-09-26 16:24:46 +02:00
David Dias
1ba8e80d4d rm laf 2015-09-23 20:34:31 +01:00
David Dias
5b7a6051ad comment undone tests 2015-09-23 20:07:55 +01:00
David Dias
2000827273 add identify 2015-09-23 19:14:29 +01:00
David Dias
168d01befd stream muxer for connection reuse test 2015-09-23 17:25:21 +01:00
David Dias
0040be765d add spdy + test 2015-09-23 17:11:32 +01:00
David Dias
416e107d64 quick fix for travis 2015-09-22 17:50:41 +01:00
David Dias
59b00f6886 use warmed up connection + test 2015-09-22 17:27:37 +01:00
David Dias
8e8d8e9093 dial on a protocol + test 2015-09-22 16:50:42 +01:00
David Dias
5e4cca52c0 dial a conn + test 2015-09-22 16:16:21 +01:00
David Dias
e1df0b9ecd add transport and close listener test 2015-09-22 14:31:23 +01:00
dignifiedquire
17f40911db identify: Fix some issues with updateSelf. 2015-08-04 12:10:17 +02:00
dignifiedquire
f1d796f47b Fix swarm.closeConns 2015-07-31 23:13:05 +02:00
dignifiedquire
13659ecb40 swarm: Fix self.handles data structure 2015-07-31 17:56:36 +02:00
dignifiedquire
85e312dc66 Start adding more swarm tests 2015-07-31 17:40:55 +02:00
David Dias
02e07993da add/update lastSeen to a peer once a stream is open 2015-07-30 14:58:32 -07:00
David Dias
5a4d9ee4ed Identify working with protobufs and observed addrs 2015-07-17 12:05:02 -07:00
David Dias
0d82f9decc remove unnecessary logs 2015-07-15 15:38:01 -07:00
David Dias
1ed32f6531 fix RST_STREAM bug 2015-07-15 12:20:52 -07:00
David Dias
93509debe1 add multistream and muxer tests 2015-07-15 11:34:40 -07:00
David Dias
a2a7df870b add multistream and muxer tests 2015-07-15 11:34:37 -07:00
David Dias
b4cc1d5852 connection reuse with identify 2015-07-10 14:06:51 -07:00
David Dias
a5b2524873 connection reuse test 2015-07-10 12:28:40 -07:00
David Dias
0aab8ead56 for indutny 2015-07-09 20:00:54 -07:00
David Dias
6c82973315 identify + test refactor and reorg 2015-07-09 13:53:09 -07:00
David Dias
572c7e4cfa identify + test refactor and reorg 2015-07-09 13:53:03 -07:00
David Dias
9c062ffeeb have at least one test 2015-07-08 23:01:36 -07:00
David Dias
a74aac6e11 Initial Commit 2015-07-08 16:22:59 -07:00