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.
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.