mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-07-02 10:21:49 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
4b0851b4a4 | |||
74771b9504 | |||
48eefa1b40 | |||
f8f52665f7 |
10
CHANGELOG.md
10
CHANGELOG.md
@ -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>
|
<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)
|
## [0.11.2](https://github.com/libp2p/js-libp2p-tcp/compare/v0.11.1...v0.11.2) (2018-01-12)
|
||||||
|
|
||||||
|
13
package.json
13
package.json
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "libp2p-tcp",
|
"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",
|
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "aegir lint",
|
"lint": "aegir lint",
|
||||||
"test": "aegir test --t node",
|
"test": "aegir test -t node",
|
||||||
"release": "aegir release -t node --no-build",
|
"release": "aegir release -t node --no-build",
|
||||||
"release-minor": "aegir release -t node --type minor --no-build",
|
"release-minor": "aegir release -t node --type minor --no-build",
|
||||||
"release-major": "aegir-release -t node --type major --no-build",
|
"release-major": "aegir-release -t node --type major --no-build",
|
||||||
"coverage": "aegir coverage",
|
"coverage": "aegir coverage",
|
||||||
"coverage-publish": "aegir coverage --provider coveralls"
|
"coverage-publish": "aegir coverage --provider coveralls"
|
||||||
},
|
},
|
||||||
"pre-commit": [
|
"pre-push": [
|
||||||
"lint",
|
"lint",
|
||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
@ -34,11 +34,11 @@
|
|||||||
"npm": ">=3.0.0"
|
"npm": ">=3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"aegir": "^12.3.0",
|
"aegir": "^12.4.0",
|
||||||
"chai": "^4.1.2",
|
"chai": "^4.1.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"interface-transport": "~0.3.5",
|
"interface-transport": "~0.3.5",
|
||||||
"lodash.isfunction": "^3.0.8",
|
"lodash.isfunction": "^3.0.9",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
"pull-stream": "^3.6.1"
|
"pull-stream": "^3.6.1"
|
||||||
},
|
},
|
||||||
@ -47,7 +47,7 @@
|
|||||||
"interface-connection": "~0.3.2",
|
"interface-connection": "~0.3.2",
|
||||||
"ip-address": "^5.8.9",
|
"ip-address": "^5.8.9",
|
||||||
"lodash.includes": "^4.3.0",
|
"lodash.includes": "^4.3.0",
|
||||||
"lodash.isfunction": "^3.0.8",
|
"lodash.isfunction": "^3.0.9",
|
||||||
"mafmt": "^3.0.2",
|
"mafmt": "^3.0.2",
|
||||||
"multiaddr": "^3.0.2",
|
"multiaddr": "^3.0.2",
|
||||||
"once": "^1.4.0",
|
"once": "^1.4.0",
|
||||||
@ -61,6 +61,7 @@
|
|||||||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
|
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
|
||||||
"Greenkeeper <support@greenkeeper.io>",
|
"Greenkeeper <support@greenkeeper.io>",
|
||||||
"João Antunes <j.goncalo.antunes@gmail.com>",
|
"João Antunes <j.goncalo.antunes@gmail.com>",
|
||||||
|
"Pedro Teixeira <i@pgte.me>",
|
||||||
"Prashanth Chandra <coolshanth94@gmail.com>",
|
"Prashanth Chandra <coolshanth94@gmail.com>",
|
||||||
"Richard Littauer <richard.littauer@gmail.com>",
|
"Richard Littauer <richard.littauer@gmail.com>",
|
||||||
"Stephen Whitmore <stephen.whitmore@gmail.com>"
|
"Stephen Whitmore <stephen.whitmore@gmail.com>"
|
||||||
|
@ -55,23 +55,19 @@ module.exports = (handler) => {
|
|||||||
callback = callback || noop
|
callback = callback || noop
|
||||||
options = options || {}
|
options = options || {}
|
||||||
|
|
||||||
let closed = false
|
const timeout = setTimeout(() => {
|
||||||
server.close(callback)
|
|
||||||
|
|
||||||
server.once('close', () => {
|
|
||||||
closed = true
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
if (closed) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
log('unable to close graciously, destroying conns')
|
log('unable to close graciously, destroying conns')
|
||||||
Object.keys(server.__connections).forEach((key) => {
|
Object.keys(server.__connections).forEach((key) => {
|
||||||
log('destroying %s', key)
|
log('destroying %s', key)
|
||||||
server.__connections[key].destroy()
|
server.__connections[key].destroy()
|
||||||
})
|
})
|
||||||
}, options.timeout || CLOSE_TIMEOUT)
|
}, options.timeout || CLOSE_TIMEOUT)
|
||||||
|
|
||||||
|
server.close(callback)
|
||||||
|
|
||||||
|
server.once('close', () => {
|
||||||
|
clearTimeout(timeout)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let ipfsId
|
let ipfsId
|
||||||
|
Reference in New Issue
Block a user