Skip to content

SocketmapClient

Defined in: net-socketmap/src/socketmap/socketmap-client.ts:46

Postfix socketmap client.

Implements the socketmap lookup protocol over netstring framing. The protocol is purely request-response with no unsolicited frames, so every inbound netstring answers the preceding lookup.

Spec: http://www.postfix.org/socketmap_table.5.html

new SocketmapClient(source, options?): SocketmapClient

Defined in: net-socketmap/src/socketmap/socketmap-client.ts:59

Transport

Any Transport. Postfix socketmaps are usually reached over a Unix socket — for a Node.js Duplex/net.Socket, wrap it first: new DuplexTransport(socket) from @ac-kit/net-transport-node.

SocketmapClientOptions

Buffer, payload-length and timeout tuning.

SocketmapClient

Session< Uint8Array, Uint8Array | string, SocketmapClientEvents >.constructor

get buffered(): number

Defined in: net-core/src/session.ts:243

Bytes received but not yet decoded.

number

Session.buffered


get pendingExchanges(): number

Defined in: net-core/src/session.ts:248

Number of outstanding exchanges, including abort tombstones.

number

Session.pendingExchanges

[asyncDispose](): Promise<void>

Defined in: net-core/src/session.ts:277

Destroys the session, so it can be used with await using.

Promise<void>

Session.[asyncDispose]


destroy(error?): void

Defined in: net-core/src/session.ts:271

Tear the session down, rejecting every outstanding exchange.

Rejection happens here rather than relying on the transport emitting close, so callers are never left with promises that hang against a transport that closes silently.

unknown

Optional cause reported to outstanding exchanges.

void

Session.destroy


end(): Promise<void>

Defined in: net-core/src/session.ts:258

Half-close the outbound direction and flush pending writes.

Prefer this over destroy for protocols with a farewell command, so the peer sees an orderly shutdown.

Promise<void>

Session.end


isSubscribed<K>(event, listener): boolean

Defined in: async/src/events/event-dispatcher-map-base.ts:38

Check if a callback is subscribed to a specific event.

K extends keyof BaseSessionEvents

K

The event name.

Callable<BaseSessionEvents[K]>

The callback to check.

boolean

Session.isSubscribed


lookup(table, key, options?): Promise<SocketmapResult>

Defined in: net-socketmap/src/socketmap/socketmap-client.ts:76

Look a key up in a table.

string

The socketmap table name, for example forward.

string

The key to look up.

ExchangeOptions<Uint8Array<ArrayBufferLike>>

Abort, timeout and abort-policy overrides.

Promise<SocketmapResult>

The status token and its accompanying value.


subscribe<K>(event, listener, options?): Callable | null

Defined in: async/src/events/event-dispatcher-map-base.ts:23

K extends keyof BaseSessionEvents

K

Callable<BaseSessionEvents[K]>

EventDispatcherSubscribeOptions

Callable | null

Session.subscribe


unsubscribe<K>(event, listener): void

Defined in: async/src/events/event-dispatcher-map-base.ts:31

Unsubscribe a callback from a specific event.

K extends keyof BaseSessionEvents

K

The event name.

Callable<BaseSessionEvents[K]>

The callback to remove.

void

Session.unsubscribe


wait<K>(event, options?): Promise<BaseSessionEvents[K]>

Defined in: async/src/events/event-dispatcher-map-base.ts:45

Wait for the next occurrence of a specific event, optionally matching a predicate.

This is a convenience method that subscribes to the dispatcher, waits for the next event that matches the predicate (if provided), and then unsubscribes automatically.

K extends keyof BaseSessionEvents

K

The event name to wait for.

EventDispatcherWaitOptions<BaseSessionEvents[K]>

Optional settings including predicate and abort signal.

Promise<BaseSessionEvents[K]>

A promise that resolves with the event arguments as an array.

Session.wait