Interface Sockets
interface Sockets {
kernel: Kernel;
all(): Map<string, SocketConnection>;
close(id: string): Promise<void>;
createWebSocket(
url: string,
options?: { protocols?: string | string[] },
): Promise<WebSocketConnection>;
createWebTransport(
url: string,
options?: { allowPooling?: boolean },
): Promise<WebTransportConnection>;
get(id: string): undefined | SocketConnection;
}
kernel: Kernel;
all(): Map<string, SocketConnection>;
close(id: string): Promise<void>;
createWebSocket(
url: string,
options?: { protocols?: string | string[] },
): Promise<WebSocketConnection>;
createWebTransport(
url: string,
options?: { allowPooling?: boolean },
): Promise<WebTransportConnection>;
get(id: string): undefined | SocketConnection;
}
Index
Properties
Methods
Methods
all
- all(): Map<string, SocketConnection>
Get all active connections
Returns Map<string, SocketConnection>
Map of all connections
close
createWebSocket
- createWebSocket(
url: string,
options?: { protocols?: string | string[] },
): Promise<WebSocketConnection> Create a new WebSocket connection
Parameters
- url: string
WebSocket URL (ws:// or wss://)
Optionaloptions: { protocols?: string | string[] }Optional WebSocket configuration
Returns Promise<WebSocketConnection>
Promise that resolves to the WebSocket connection
- url: string
createWebTransport
- createWebTransport(
url: string,
options?: { allowPooling?: boolean },
): Promise<WebTransportConnection> Create a new WebTransport connection
Parameters
- url: string
WebTransport URL (https://)
Optionaloptions: { allowPooling?: boolean }Optional WebTransport configuration
Returns Promise<WebTransportConnection>
Promise that resolves to the WebTransport connection
- url: string
get
- get(id: string): undefined | SocketConnection
Get a connection by ID
Parameters
- id: string
Connection ID
Returns undefined | SocketConnection
The connection or undefined if not found
- id: string
Interface for socket connection management functionality