Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSend "stop" to trackers during shutdown #313
Comments
This comment has been minimized.
This comment has been minimized.
|
Is this as simple as calling self.stop() from WebTorrent.prototype.destroy ? or am i missing something? |
This comment has been minimized.
This comment has been minimized.
|
Probably |
This comment has been minimized.
This comment has been minimized.
|
i will! UPDATE :( too n00b for this, i thought we were already using bittorrent-tracker/client and was as simple as calling it. Anyway, the stop event on the server is being called, check this out
|
This comment has been minimized.
This comment has been minimized.
|
This seems to already be the case, it's called when torrent is removed |
This comment has been minimized.
This comment has been minimized.
|
@janza @sudoaza You guys are right. There may be a timing issue where the server doesn't get the 'stop' event if the client shuts down too quickly because we don't wait for confirmation. See here. There's no callback to wait for the response. But I think this is okay. We don't want to delay the process exiting to wait for some slow, overloaded tracker on the other side of the world to respond to us. |
The tracker protocol (and bittorrent-tracker) has a method to tell the tracker that a client is leaving the swarm, so the tracker can remove it's "ip:port" from the list of clients.
From the bittorrent-tracker API:
Let's do this.