typescript
interface ConnectionActive connection interface
Properties
isConnected
boolean
Whether the connection is active
socket
Socket
Underlying socket
Methods
close(): Promise<void>Close the connection
Returns
Promise<void>onClose(handler: () => void): voidRegister a close handler
Parameters
handler:() => void
Returns
voidonError(handler: (error: Error) => void): voidRegister an error handler
Parameters
handler:(error: Error) => void
Returns
voidonMessage(handler: (message: TypedResult) => void): voidRegister a message handler
Parameters
Returns
voidsend(message: TypedMessage<T>): Promise<void>Send a message through the connection
Parameters
Returns
Promise<void>