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

Handle PeerExchangeManager on the right thread #696

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

alanmcgovern
Copy link
Owner

Rather than listening to the events, which are asynchronous, just call the PeerExchangeManager methods directly when a peer connects or disconnects. This ensures the methods are called on the main thread.

Probably fixes #695, where null reference exceptions are thrown when encoding peers in a peer exchange message.

One codepath/thread probably added/removed peers from the list and another thread did the same. This left things out of sync.

Rather than listening to the events, which are asynchronous, just call
the PeerExchangeManager methods directly when a peer connects or
disconnects. This ensures the methods are called on the main thread.

Probably fixes the issue where null reference exceptions are thrown when
encoding peers in a peer exchange message.

One codepath/thread probably added/removed peers from the list and
another thread did the same. This left things out of sync.
@alanmcgovern alanmcgovern merged commit 3a2bdff into master Sep 9, 2024
0 of 2 checks passed
@alanmcgovern alanmcgovern deleted the fix-peer-exchange branch September 9, 2024 00:29
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

Successfully merging this pull request may close these issues.

Program crash with large of downloading torrents
1 participant