IWebSocketClient
Interface for WebSocket client. If you need extra functionality or customize how message sent and receive from cloud node,
you can implement this interface and pass to CloudWebSocketClient
initialization.
Methods
close
▸ close(): Promise
<any
>
Returns
Promise
<any
>
connect
▸ connect(url
, protocols
, options?
): Promise
<void
>
Parameters
Name | Type |
---|---|
url | string |
protocols | string [] |
options? | WebSocketOptions |
Returns
Promise
<void
>
read
▸ read(): Promise
<Uint8Array
>
Returns
Promise
<Uint8Array
>
reset
▸ reset(): void
Returns
void
send
▸ send(data
): void
Parameters
Name | Type |
---|---|
data | string |
Returns
void
sendText
▸ sendText(data
): void
Parameters
Name | Type |
---|---|
data | string |
Returns
void
waitRemoteClose
▸ waitRemoteClose(): Promise
<undefined
| number
>
Returns
Promise
<undefined
| number
>