Skip to content
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

Merged
merged 2 commits into from Jun 11, 2019
Merged

ability to close and restore streaming server #1547

merged 2 commits into from Jun 11, 2019

Conversation

untitledlt
Copy link
Contributor

@untitledlt untitledlt commented Nov 22, 2018

Added ability to restore steaming server by calling .listen(port) on existing server which was closed before with .close()

registered issue: #1545

@request-info
Copy link

request-info bot commented Nov 22, 2018

👋 We would appreciate it if you could provide us with more information about this issue.

@welcome
Copy link

welcome bot commented Nov 22, 2018

🙌 Thanks for opening this pull request! You're awesome.

@stale
Copy link

stale bot commented Apr 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Apr 7, 2019
lib/server.js Outdated
closed = false
server.on('connection', onConnection)
server.on('request', onRequest)
_listen.call(server, port)
Copy link
Member

@alxhotel alxhotel Apr 7, 2019

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
Copy link
Member

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).

@stale stale bot removed stale labels Apr 7, 2019
@untitledlt
Copy link
Contributor Author

@alxhotel please see updated PR

@untitledlt
Copy link
Contributor Author

@alxhotel @DiegoRBaquero any chance to get this merged any time soon?

@DiegoRBaquero DiegoRBaquero merged commit d7eeee2 into webtorrent:master Jun 11, 2019
@welcome
Copy link

welcome bot commented Jun 11, 2019

🎉 Congrats on getting your first pull request landed!

@DiegoRBaquero
Copy link
Member

Do you need this published to npm?

@untitledlt
Copy link
Contributor Author

Sure. Thanks!

@feross feross mentioned this pull request Sep 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants