mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-06-12 20:51:40 +00:00
fix: ensure timeline.close is set (#113)
* fix(test): dns4 isnt a valid tcp multiaddr It should be resolved first * fix: ensure timeline.close is set on the multiaddrConn * chore: add docs to gitignore They are generated and uploaded on release
This commit is contained in:
@ -79,5 +79,14 @@ module.exports = (socket, options) => {
|
||||
}
|
||||
}
|
||||
|
||||
socket.once('close', () => {
|
||||
// In instances where `close` was not explicitly called,
|
||||
// such as an iterable stream ending, ensure we have set the close
|
||||
// timeline
|
||||
if (!maConn.timeline.close) {
|
||||
maConn.timeline.close = Date.now()
|
||||
}
|
||||
})
|
||||
|
||||
return maConn
|
||||
}
|
||||
|
Reference in New Issue
Block a user