PacketWriteTransport

The interface providing write operations on serialized packet data.

The minecraft protocol has optional compression and encryption, and this interface is there to abstract away details about how packet data is transmitted between client and server.

class Object
trait Matchable
class Any

Value members

Abstract methods

def write(id: PacketId, data: Chunk[Byte]): F[Unit]

Write data of a single packet to the peer.

Write data of a single packet to the peer.

This action

  • must acquire mutex guard of the underlying write buffer to avoid multiple writes occurring at once
  • must be atomic within cancellation semnatics. When it is cancelled, it must write the entire chunk or nothing at all, provided that no error is raised