Compare commits

...

4 Commits

Author SHA1 Message Date
4b0851b4a4 chore: release version v0.11.3 2018-02-07 05:45:42 +00:00
74771b9504 chore: update contributors 2018-02-07 05:45:42 +00:00
48eefa1b40 chore: update deps 2018-02-07 05:45:30 +00:00
f8f52665f7 fix: clearing timeout when closes (#87) 2018-02-07 05:43:15 +00:00
3 changed files with 24 additions and 17 deletions

View File

@ -1,3 +1,13 @@
<a name="0.11.3"></a>
## [0.11.3](https://github.com/libp2p/js-libp2p-tcp/compare/v0.11.2...v0.11.3) (2018-02-07)
### Bug Fixes
* clearing timeout when closes ([#87](https://github.com/libp2p/js-libp2p-tcp/issues/87)) ([f8f5266](https://github.com/libp2p/js-libp2p-tcp/commit/f8f5266))
<a name="0.11.2"></a>
## [0.11.2](https://github.com/libp2p/js-libp2p-tcp/compare/v0.11.1...v0.11.2) (2018-01-12)

View File

@ -1,18 +1,18 @@
{
"name": "libp2p-tcp",
"version": "0.11.2",
"version": "0.11.3",
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
"main": "src/index.js",
"scripts": {
"lint": "aegir lint",
"test": "aegir test --t node",
"test": "aegir test -t node",
"release": "aegir release -t node --no-build",
"release-minor": "aegir release -t node --type minor --no-build",
"release-major": "aegir-release -t node --type major --no-build",
"coverage": "aegir coverage",
"coverage-publish": "aegir coverage --provider coveralls"
},
"pre-commit": [
"pre-push": [
"lint",
"test"
],
@ -34,11 +34,11 @@
"npm": ">=3.0.0"
},
"devDependencies": {
"aegir": "^12.3.0",
"aegir": "^12.4.0",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"interface-transport": "~0.3.5",
"lodash.isfunction": "^3.0.8",
"lodash.isfunction": "^3.0.9",
"pre-commit": "^1.2.2",
"pull-stream": "^3.6.1"
},
@ -47,7 +47,7 @@
"interface-connection": "~0.3.2",
"ip-address": "^5.8.9",
"lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.8",
"lodash.isfunction": "^3.0.9",
"mafmt": "^3.0.2",
"multiaddr": "^3.0.2",
"once": "^1.4.0",
@ -61,6 +61,7 @@
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Greenkeeper <support@greenkeeper.io>",
"João Antunes <j.goncalo.antunes@gmail.com>",
"Pedro Teixeira <i@pgte.me>",
"Prashanth Chandra <coolshanth94@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>"

View File

@ -55,23 +55,19 @@ module.exports = (handler) => {
callback = callback || noop
options = options || {}
let closed = false
server.close(callback)
server.once('close', () => {
closed = true
})
setTimeout(() => {
if (closed) {
return
}
const timeout = setTimeout(() => {
log('unable to close graciously, destroying conns')
Object.keys(server.__connections).forEach((key) => {
log('destroying %s', key)
server.__connections[key].destroy()
})
}, options.timeout || CLOSE_TIMEOUT)
server.close(callback)
server.once('close', () => {
clearTimeout(timeout)
})
}
let ipfsId