Skip to main content
Version: v0.0.3

Interface: ConnectionOptions

Options for constructing a Connection.

Example

const opts: ConnectionOptions = {
transport: new NetTransport(socket),
onMessage: (payload) => handleMessage(payload),
onWarning: (w) => logger.warn(w),
drainTimeoutMs: 10_000,
};

Properties

drainTimeoutMs?

optional drainTimeoutMs?: number

Drain timeout used by close() (default: 30_000 ms).


framing?

optional framing?: Omit<FrameReaderOptions, "onFrame" | "onWarning">

FrameReader options (tolerance, maxFrameSizeBytes). onFrame/onWarning are managed internally.


onMessage?

optional onMessage?: (payload) => void

Called for each decoded MLLP frame (raw payload bytes, framing stripped).

Parameters

payload

Buffer

Returns

void


onWarning?

optional onWarning?: (w) => void

Per-connection warning subscriber. Replaces previous subscription.

Parameters

w

MllpWarning

Returns

void


transport

transport: Transport

The transport this Connection will drive.