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.
HazelPipelineSegment is a new wrapper around a blocking collection and thread pool. Technically receive workers could also be refactored to use one of these, but I didn't wanna go too crazy.
Moved some of the private DTLS structs into new files.
Also cleaned up and made some of the core tests more reliable.
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.