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

Treat peers as 'connecting' until the handshake completes #689

Closed alanmcgovern closed 2 months ago

alanmcgovern commented 2 months ago

We allow up to 'Timeout' seconds to establish a connection. We now also allow an additional 'Timeout' seconds for the handshake to complete before the connection is discarded.

A recent change made it so that peers who are in the handshaking phase are no longer counted as 'connected', so the timeout which disconnects peers who don't send messages within a reasonable amount of time doesn't apply, and prior to this commit the connection timeout only applied to the actual Socket.Connect.