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

Push DTLS layer processing onto multithreading #29

Closed Mukikaizoku closed 2 years ago

Mukikaizoku commented 2 years ago

Context: Hazel listener uses a single thread for pulling UDP receives and n-threads for processing the receive message data. However, the DTLS layer intercepts the message processing before the work load is distributed to the pool of threads. DTLS processing is a heavy operation and having all incoming messages undergo DTLS processing on the same thread is poor for performance and scalability.

This change distributes the DTLS processing layer across the n-threads dedicated for processing receive message data.