willardf / Hazel-Networking

Hazel Networking is a low level networking library for C# providing connection-oriented, message-based communication via RUDP.
MIT License
385 stars 60 forks source link

Reduce send locking and add parallel-pipelining #50

Open willardf opened 1 year ago

willardf commented 1 year ago

This only affects application data packets. Receives and internal sends like handshakes still lock the peer to avoid untangling that whole mess, but in principle, the pattern would support all of it.

Adding more threads into the send process creates some gotchas with disconnecting, so I also had to make a more synchronous path to ensure the encryption context is valid when we want to disconnect.