receive

suspend fun receive(): Packet?

Returns the next packet that is scheduled to be send to the receiver. If there are no packets up for immediate sending this will suspend until one is added by a call to sendData or if the timeout of any packets in the buffer expire, triggering an automatic repeat request (a resend). Returns null when the buffer is currently being destroyed.