I'll describe this in more detail when I get a chance, but it's based on @Mukikaizoku's outline for message queues. The big refactor is actually combining the PeerData and DtlsServerConnection classes. This allows for a lot more certainty around adding and removing connections during handshake. There is also a couple of new concurrent set structures which allows us to either cycle connections across multiple threads or assert thread affinity.
WIP stuff:
I believe there still might be some scenario which can be optimized around connections that have just disconnected and received an errant packet after. Possibly some holes around peers that drop during handshake as well.
It feels a little bit unstable, failing to respond to pings under load.
I'll describe this in more detail when I get a chance, but it's based on @Mukikaizoku's outline for message queues. The big refactor is actually combining the PeerData and DtlsServerConnection classes. This allows for a lot more certainty around adding and removing connections during handshake. There is also a couple of new concurrent set structures which allows us to either cycle connections across multiple threads or assert thread affinity.
WIP stuff: