Implemented non-blocking random packet delay: a packet is assigned a
delay time, and the transmission will occur asynchronously, while the
reception of packets can go on in the main thread.