Clients -
http :
WebSocketCaller
Represents a WebSocket caller.
Remote Methods
pushText | Pushes text to the connection. If an error occurs while sending the text message to the connection, that message will be lost. |
pushBinary | Pushes binary data to the connection. If an error occurs while sending the binary message to the connection, that message will be lost. |
ping | Pings the connection. If an error occurs while sending the ping frame to the server, that frame will be lost. |
pong | Sends a pong message to the connection. If an error occurs while sending the pong frame to the connection, that frame will be lost. |
close | Closes the connection. |
Methods
pushText
(string | json | xml | boolean | int | float | byte | byte[] data, boolean finalFrame)
returns WebSocketError?Parameters
- data string | json | xml | boolean | int | float | byte | byte[]
-
Data to be sent. If it is a byte[], it is converted to a UTF-8 string for sending
- finalFrame boolean (default true)
-
Set to
true
if this is a final frame of a (long) message
-
Return Type
(WebSocketError?) An
error
if an error occurs when sending
Parameters
- data byte[]
-
Binary data to be sent
- finalFrame boolean (default true)
-
Set to
true
if this is a final frame of a (long) message
-
Return Type
(WebSocketError?) An
error
if an error occurs when sending
Parameters
- data byte[]
-
Binary data to be sent
-
Return Type
(WebSocketError?) An
error
if an error occurs when sending
Parameters
- data byte[]
-
Binary data to be sent
-
Return Type
(WebSocketError?) An
error
if an error occurs when sending
Parameters
- statusCode int? (default 1000)
-
Status code for closing the connection
- reason string? (default ())
-
Reason for closing the connection
- timeoutInSeconds int (default 60)
-
Time to wait for the close frame to be received from the remote endpoint before closing the connection. If the timeout exceeds, then the connection is terminated even though a close frame is not received from the remote endpoint. If the value < 0 (e.g., -1), then the connection waits until a close frame is received. If WebSocket frame is received from the remote endpoint within the waiting period, the connection is terminated immediately.
-
Return Type
(WebSocketError?) An
error
if an error occurs when sending
Parameters
- key string
-
The key, which identifies the attribute
- value any
-
The value of the attribute
Parameters
- key string
-
The key to identify the attribute
-
Return Type
(any) The attribute related to the given key or
nil
Parameters
- key string
-
The key to identify the attribute
-
Return Type
(any) The attribute related to the given key or
nil
-
Return Type
(string) The unique ID associated with the connection
-
Return Type
(string?) The subprotocol if any negotiated with the client or
nil
-
Return Type
(boolean) true
if the connection is secure