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

peer._destroy is not a function On torrent.pause() #784

Closed
Lunik opened this issue Apr 30, 2016 · 2 comments
Closed

peer._destroy is not a function On torrent.pause() #784

Lunik opened this issue Apr 30, 2016 · 2 comments

Comments

@Lunik
Copy link
Contributor

@Lunik Lunik commented Apr 30, 2016

  • WebTorrent version:
    0.91.2
  • Node.js version:
    5.11.0

I get this issues when I'm pausing the client before destroy him:

/home/lunik/torrent/node_modules/webtorrent/lib/torrent.js:716
  if (self.paused) return peer._destroy(new Error('torrent is paused'))
                               ^

TypeError: peer._destroy is not a function
    at Torrent._addIncomingPeer (/home/lunik/torrent/node_modules/webtorrent/lib/torrent.js:716:32)
    at Wire.onHandshake (/home/lunik/torrent/node_modules/webtorrent/lib/tcp-pool.js:109:15)
    at Wire.g (events.js:273:16)
    at emitThree (events.js:115:20)
    at Wire.emit (events.js:188:7)
    at Wire._onHandshake (/home/lunik/torrent/node_modules/bittorrent-protocol/index.js:434:8)
    at Wire._parser (/home/lunik/torrent/node_modules/bittorrent-protocol/index.js:700:12)
    at Wire._write (/home/lunik/torrent/node_modules/bittorrent-protocol/index.js:591:10)
    at doWrite (/home/lunik/torrent/node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/home/lunik/torrent/node_modules/bittorrent-protocol/node_modules/readable-stream/lib/_stream_writable.js:302:5)
function stop(client) {
  if (client.torrent) {
    client.torrent.pause()
    setTimeout(function () {
      client.torrent.destroy()
    }, 1000)
  }
}
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 4, 2016

Fixed in 0.91.4

@feross feross closed this in b276d8e May 4, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.