alanmcgovern / monotorrent

The official repository for MonoTorrent, a bittorrent library for .NET
https://github.com/alanmcgovern/monotorrent
MIT License
1.15k stars 397 forks source link

Better handling of incoming and outgoing connections #697

Closed alanmcgovern closed 2 months ago

alanmcgovern commented 2 months ago

PeerId objects are now guaranteed to run their disposal logic exactly once, which ensures retries are attempted at the right time.

Additionally, PeerId objects are only created when the session is fully initialised, making it harder to add them to internal lists before everything is ready. This also makes cleanup easier if the connection attempt fails as the only thing which needs to be done is to dispose the IPeerConnection object :)