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 upseed / destroy race condition prevent destruction #254
Comments
This comment has been minimized.
This comment has been minimized.
|
Good catch. I'll fix this up. We don't actually need to make the var net = require('net')
var socket = net.connect(4000, function () {
console.log('listen')
})
socket.destroy()will not log |
This comment has been minimized.
This comment has been minimized.
|
Fixed this issue, added tests, and released as 0.27.0. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
to repro:
seed() calls self.add asynchronously and ends up adding to self.torrents after destroy empties it
I suggest something like bittorrent-dht has - self._destroyed with checks, and can implement it if you like. However, this will likely force changes to the ontorrent callback signature. Currently it's not a traditional node callback - ontorrent(torrent), but it will likely need to become one, a la: