New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ability to close and restore streaming server #1547
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
lib/server.js
Outdated
closed = false | ||
server.on('connection', onConnection) | ||
server.on('request', onRequest) | ||
_listen.call(server, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make this compatible and pass the tests, it should be changed to:
server.listen = (...args) => {
...
_listen.apply(server, args)
}
@@ -25,7 +30,6 @@ function Server (torrent, opts = {}) { | |||
const onReady = pendingReady.pop() | |||
torrent.removeListener('ready', onReady) | |||
} | |||
torrent = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move torrent = null
inside server.destroy(cb)
.
@alxhotel please see updated PR |
@alxhotel @DiegoRBaquero any chance to get this merged any time soon? |
Do you need this published to npm? |
Sure. Thanks! |
Added ability to restore steaming server by calling
.listen(port)
on existing server which was closed before with.close()
registered issue: #1545