Closed alanmcgovern closed 3 months ago
emmm,is there no way to optimize it further? The first time to download from torrent file, it always get this problem
That depends on what you mean. If you're wondering if hashes can be fetched faster - try the fix first. Performance will improve because messages will actually be sent to other peers after they're queued.
If there's another issue - could you open a new issue describing the particular performance issue you experience?
This fixes a race condition where peers would sometimes get stuck while fetching bittorrent v2 hashes, depending on the timing of when the first request was made and then the final part of the handshake completed.
If requests were enqueued early, everything was fine. If requests were queued late, then nothing would kick off the queue consumer and enqueued messages would be left pending until the peer timed out, or until a KeepAlive message was sent which would unblock the queue.
Addresses issues like https://github.com/alanmcgovern/monotorrent/issues/672