Methods
setCloseHandler
- setCloseHandler(handler: (error: undefined | Error, code: number, text: string) => void): Promise<void>
Parameters
handler: (error: undefined | Error, code: number, text: string) => void
- (error: undefined | Error, code: number, text: string): void
Parameters
error: undefined | Error
code: number
text: string
Returns void
Returns Promise<void>
setMessageHandler
- setMessageHandler(handler: (error: undefined | Error, message: string | Uint8Array) => void): Promise<Cancellable>
Parameters
handler: (error: undefined | Error, message: string | Uint8Array) => void
- (error: undefined | Error, message: string | Uint8Array): void
Parameters
error: undefined | Error
message: string | Uint8Array
Returns void
setPongHandler
- setPongHandler(handler: (error: undefined | Error, msg: string) => void): Promise<void>
Parameters
handler: (error: undefined | Error, msg: string) => void
- (error: undefined | Error, msg: string): void
Parameters
error: undefined | Error
msg: string
Returns void
Returns Promise<void>
writeMessage
- writeMessage(message: string | Uint8Array): Promise<void>
Parameters
message: string | Uint8Array
Returns Promise<void>
Object to communicate with the websocket