Skip to content

unienv_interface.remote.transport

Ordered, reliable binary message transports. WebSocket is an optional extra.

TransportClosed

Bases: ConnectionError

MessageTransport

Bases: Protocol

One reader and one writer may run concurrently; close unblocks both.

Implementations preserve complete message boundaries and order. They must bound buffering and raise ConnectionError/OSError on transport failure.

send

send(payload: bytes) -> None

recv

recv() -> bytes

close

close() -> None

MemoryTransport

MemoryTransport(incoming: _Channel, outgoing: _Channel)

Bounded, byte-copying transport for tests and embedded deployments.

pair classmethod

pair(capacity: int = 16) -> Tuple[MemoryTransport, MemoryTransport]

send

send(payload: bytes) -> None

recv

recv() -> bytes

close

close() -> None

WebSocketTransport

WebSocketTransport(connection: Connection)

connection instance-attribute

connection = connection

connect classmethod

connect(uri: str, *, max_message_size: int = DEFAULT_MAX_MESSAGE_SIZE, **kwargs: object) -> WebSocketTransport

send

send(payload: bytes) -> None

recv

recv() -> bytes

close

close() -> None