Skip to content

Interface: MessageChannel ​

Defined in: netconf/src/transport/channel.ts:35

A connection with RFC 6242 framing on top: it delivers whole messages and frames outgoing ones. Open one with openChannel.

Properties ​

framing ​

ts
readonly framing: FramingMode;

Defined in: netconf/src/transport/channel.ts:39

The current framing mode.


peer ​

ts
readonly peer: ConnectionPeer;

Defined in: netconf/src/transport/channel.ts:37

Who the underlying connection talks to.

Methods ​

close() ​

ts
close(): Promise<void>;

Defined in: netconf/src/transport/channel.ts:53

Close the underlying connection. Idempotent; never rejects.

Returns ​

Promise<void>


destroy() ​

ts
destroy(): void;

Defined in: netconf/src/transport/channel.ts:51

Stop delivering messages and drop the stream at once. Idempotent.

Returns ​

void


encode() ​

ts
encode(message): Uint8Array;

Defined in: netconf/src/transport/channel.ts:45

Frame a message without sending it, so a caller can find out before committing to a send whether it can be framed at all.

Parameters ​

message ​

string

Returns ​

Uint8Array

Throws ​

FramingError if EOM framing can't carry it (it contains ]]>]]>).


useChunkedFraming() ​

ts
useChunkedFraming(): void;

Defined in: netconf/src/transport/channel.ts:49

Switch both directions to chunked framing. Takes effect from the next message.

Returns ​

void


write() ​

ts
write(framed): void;

Defined in: netconf/src/transport/channel.ts:47

Write a message framed by encode().

Parameters ​

framed ​

Uint8Array

Returns ​

void

Released under the MIT Licence.