Compare commits

...

6 Commits

Author SHA1 Message Date
d2f91814b6 chore: release version v0.7.2 2016-06-23 08:42:03 +01:00
405f552c77 chore: update contributors 2016-06-23 08:42:02 +01:00
cba4b8b94a pass the err on the callback too 2016-06-23 08:41:54 +01:00
ae6a808fc7 chore: release version v0.7.1 2016-06-23 08:35:56 +01:00
eae6819b02 chore: update contributors 2016-06-23 08:35:56 +01:00
9ac5cca946 fix: error was passed in duplicate 2016-06-23 08:35:49 +01:00
3 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "libp2p-tcp",
"version": "0.7.0",
"version": "0.7.2",
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
"main": "lib/index.js",
"jsnext:main": "src/index.js",

View File

@ -38,9 +38,8 @@ function TCP () {
conn.emit('timeout')
})
socket.on('error', (err) => {
socket.once('error', (err) => {
callback(err)
conn.emit('error', err)
})
socket.on('connect', () => {

View File

@ -214,6 +214,15 @@ describe('dial', () => {
conn.on('end', done)
})
it('dial to non existent listener', (done) => {
const ma = multiaddr('/ip4/127.0.0.1/tcp/8989')
const conn = tcp.dial(ma)
conn.on('error', (err) => {
expect(err).to.exist
done()
})
})
it('dial on IPv6', (done) => {
const ma = multiaddr('/ip6/::/tcp/9066')
const listener = tcp.createListener((conn) => {