mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-05-29 07:41:32 +00:00
fix: error was passed in duplicate
This commit is contained in:
parent
cdfd473cac
commit
9ac5cca946
@ -38,11 +38,6 @@ function TCP () {
|
||||
conn.emit('timeout')
|
||||
})
|
||||
|
||||
socket.on('error', (err) => {
|
||||
callback(err)
|
||||
conn.emit('error', err)
|
||||
})
|
||||
|
||||
socket.on('connect', () => {
|
||||
callback(null, conn)
|
||||
conn.emit('connect')
|
||||
|
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user