Interface Channel

A channel is a bidirectional communications channel with lifecycle and error signalling. Note that creation of channels is specific to particular implementations and thus not part of the protocol.

interface Channel {
    onClose: Event<ChannelCloseEvent>;
    onError: Event<unknown>;
    onMessage: Event<MessageProvider>;
    close(): void;
    getWriteBuffer(): WriteBuffer;
}

Implemented by

Properties

The remote side has closed the channel

onError: Event<unknown>

An error has occurred while writing to or reading from the channel

A message has arrived and can be read by listeners using a MessageProvider.

Methods