Create a channel over one transport.
The constructor subscribes immediately so incoming messages can be handled as soon as the transport starts delivering them.
ProtectedclosedProtected OptionalcloseProtecteddestroyedProtected OptionalexposeProtected OptionalgetProtectedpendingProtectedpluginsProtectedsupportsProtectedtimeoutProtectedtransportProtectedarmStore a pending request and arm its timeout and abort-signal handlers.
OptionalcallOptions: CallOptionsProtectedcreateBuild a local function that forwards calls to a remote callback by id.
ProtectedcreateCreate a remote proxy rooted at a protocol path, optionally with per-call options.
OptionalcallOptions: CallOptionsProtecteddecodeDecode value and callback envelopes into local call arguments.
ProtecteddecodeDecode one value. Subclasses may override for opt-in feature envelopes.
Close the transport subscription, reject pending calls, and release callback records.
ProtectedencodeEncode call arguments into value and callback envelopes.
ProtectedencodeEncode a value and collect transferables when the transport supports them.
ProtectedexecuteRun plugin hooks and invoke the local API for one incoming request.
Return a typed proxy that sends operations to the remote API.
ProtectedhandleDispatch one incoming protocol message by message kind.
ProtectedhandleExecute an incoming request and post a protocol response.
ProtectedhandleResolve or reject the pending request associated with a response.
Optionalerror: RPCErrorProtectedhandleReject all pending requests when the transport connection closes.
Subsequent requests fail fast with RPCTransportClosedError. The channel is
not destroyed: the exposed API, plugins, and callback registry stay intact so
the instance can still be inspected. Reconnect by creating a new transport and
channel. Overridden by StreamingRPCChannel to also fail stream state.
Optionalreason: ErrorProtectedhandleProtectedinvokeInvoke the exposed local API according to one compact RPC operation.
ProtectedpostSend one protocol message and reject the pending request on write failure.
OptionalpendingId: stringOptionalonWriteError: (error: Error) => voidProtectedrejectReject a pending request when its transport write fails.
ProtectedreportReport an error from a fire-and-forget path to the optional diagnostics hook.
ProtectedrequestSend one RPC request and return the pending response promise.
Optionalargs: unknown[]OptionalcallOptions: CallOptions
Owns one RPC transport, exposes an optional local API, and creates a typed remote proxy.