drblah / multi-connect

A continuation of mpconn
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

Make it possible to poll/await the next sorted packet #1

Closed drblah closed 8 months ago

drblah commented 8 months ago

We currnetly pull packets out of the packet sorter/sequencer just after receiving a new packet from UDP. This means we don't actually send pakcets to the tun device when they are ready. Instead sending to the tun device is conditioned by incomming packets.

This can lead to a situation where we have a packet ready in the sorter, but we don't send it untill the next incomming packet.

Instead we should put the sorted packets into a queue and make it it posible for the main event loop of the server or client to await these.

This has the added benefit of simplifying the receive logic.

drblah commented 8 months ago

Solved in 9afd5d3b36cbb3516c20bf0481fbcb2507e5a1f2