writePacket

abstract suspend fun writePacket(
    packet: ByteReadPacket
): Unit

Writes a packet fully or fails if channel get closed before the whole packet has been written