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

Cannot seed and download from same Node.js process? #469

Closed
olalonde opened this issue Oct 27, 2015 · 3 comments
Closed

Cannot seed and download from same Node.js process? #469

olalonde opened this issue Oct 27, 2015 · 3 comments

Comments

@olalonde
Copy link
Contributor

@olalonde olalonde commented Oct 27, 2015

So I have a Node.js file where I start seeding a file with client1 and create a client2 that downloads it using a magnet URI. I hardcoded the torrentPort for client1 to 20001 so that it doesn't conflict with client2.

The download doesn't seem to work for some reason. However if I repeat the process but comment out the client1 download part and instead download the file using the webtorrent client from another shell session, it downloads correctly.

Is there anything in the code that might explain this? I recall seeing refusing handshake with self errors in the logs. Is this a bug related to the fact that both clients share the same node process?

Both clients have different peerIds/nodeIds.

Here's part of the log output:

Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm addPeer 183.17.152.194:20001
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer new Peer 183.17.152.194:20001
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm tcp connect attempt to 183.17.152.194:20001
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer Peer 183.17.152.194:20001 connected
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer new Peer ::ffff:183.17.152.194:51646
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer Peer ::ffff:183.17.152.194:51646 connected
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm _addIncomingPeer ::ffff:183.17.152.194:51646
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer destroy ::ffff:183.17.152.194:51646 (error: refusing to handshake with self)
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm removePeer ::ffff:183.17.152.194:51646
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm:peer destroy 183.17.152.194:20001 (error: undefined)
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm removePeer 183.17.152.194:20001
Tue, 27 Oct 2015 09:20:27 GMT bittorrent-swarm conn 183.17.152.194:20001 closed: will not re-add (max 3 attempts)

183.17.152.194 being my IP.

@olalonde olalonde changed the title Cannot seed and download from same node process? Cannot seed and download from same Node.js process? Oct 27, 2015
@olalonde

This comment has been minimized.

Copy link
Contributor Author

@olalonde olalonde commented Oct 30, 2015

Well, this is not really a priority so closing.

@olalonde olalonde closed this Oct 30, 2015
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 11, 2016

@olalonde Yeah I think this is due to the bittorrent-swarm package using the same listening port for both clients. I think this might have been fixed in the last month or two, but I can't remember.

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