Creates a new RawSocket instance that wraps ZMQ channels in a WebSocket-like interface. Initializes kernel communication channels (shell, control, stdin, iopub).
Kernel connection configuration from the connection file
Function to serialize kernel messages to string or ArrayBuffer format
PrivatechannelsZMQ channels for kernel communication. Contains shell, control, stdin (DEALER) and iopub (SUBSCRIBER) channels.
PrivateclosedFlag indicating whether the socket has been closed. Prevents message processing after closure.
PrivateconnectionKernel connection configuration from the connection file
PrivatemsgPromise chain for sequencing message receive operations. Ensures messages are processed in order by chaining async operations.
Callback invoked when the socket connection closes. Signature: (event: { wasClean: boolean; code: number; reason: string; target: unknown }) => void
Callback invoked when a socket error occurs. Signature: (event: { error: unknown; message: string; type: string; target: unknown }) => void
Callback invoked when a message is received from the kernel. Signature: (event: { data: WebSocketWS.Data; type: string; target: unknown }) => void
Callback invoked when the socket connection opens. Signature: (event: { target: unknown }) => void
ReadonlyprotocolWebSocket protocol version string. Empty for raw ZMQ sockets, matches WebSocket interface.
PrivatereceiveArray of hooks to be called when receiving messages from the kernel. Each hook receives serialized message data and must complete before the message is processed. Used for intercepting and transforming incoming messages.
PrivatesendPromise chain for sequencing message send operations. Ensures messages are sent in order by chaining async operations.
PrivatesendArray of hooks to be called when sending messages to the kernel. Each hook receives the message data and an optional callback for error reporting. Used for intercepting and transforming outgoing messages.
PrivateserializeFunction to serialize kernel messages to string or ArrayBuffer format
PrivatefirePrivategeneratePrivategeneratePrivateonPrivatepostPrivateprocessPrivatesend
Raw ZMQ socket that wraps kernel channels in WebSocket-like interface. Used by @jupyterlab/services for kernel communication.