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

Reset unchoked/interested state on 'end' #3

Closed
astro opened this issue Mar 11, 2014 · 2 comments
Closed

Reset unchoked/interested state on 'end' #3

astro opened this issue Mar 11, 2014 · 2 comments

Comments

@astro
Copy link
Contributor

astro commented Mar 11, 2014

Just an idea: wire instances have state bits (unchoked/interested) that have an initial default.

I'd hook on('interested') to potentially unchoke a peer, and then on('uninterested') to remove them from the list of unchokable peers. I'd do the latter equivalently on wire disconnect, on('end').

Hence the question: should we emit('uninterested') if the peer state was interested but the wire ended? Same for emit('choked')?

The changes would be minimal but the semantics would make usage easier.

feross added a commit that referenced this issue Mar 16, 2014
@feross
Copy link
Member

feross commented Mar 16, 2014

This seems like a reasonable change. Done.

@feross
Copy link
Member

feross commented Mar 16, 2014

Published as bittorrent-protocol@0.8.0

@feross feross closed this as completed Mar 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants