Implements a WebSocket client. More...


Public Member Functions | |
| _.Library.Status | OnClose () |
| Closes the web socket connection from the client. | |
| _.Library.Boolean | Next (_.Library.Integer pTimeout, _.Library.Boolean pTimedOut) |
| Waits for data from the server. More... | |
| _.Library.Status | Ping (_.Library.String pMessage, _.Library.Integer pTimeout) |
| Sends a ping frame to the server. More... | |
| _.Library.Status | Pong (_.Library.String pMessage) |
| Sends an unsolicited pong frame to the server. More... | |
| _.Library.Status | Send (pContent, _.Library.Integer pFragmentSize) |
| Sends a binary or character stream, dynamic object, or string to the server. More... | |
Public Member Functions inherited from RegisteredObject | |
| _.Library.Status | OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount) |
| This callback method is invoked when the current object is added to the SaveSet,. More... | |
| _.Library.Status | OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned) |
| This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More... | |
| _.Library.Status | OnNew () |
| This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
| _.Library.Status | OnValidateObject () |
| This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More... | |
Public Attributes | |
| URL | |
| WebSocket endpoint. More... | |
Private Member Functions | |
| __EstablishConnection () | |
| Makes the initial HTTP request and negotiates the upgrade to WebSocket protocol. | |
| _.Library.Status | __ValidateProtocolSwitch () |
| Ensures response headers are valid for upgrading to web sockets. | |
Private Attributes | |
| __AcceptedProtocols | |
| Accepted protocols (Sec-WebSocket-Protocol request header) More... | |
| __Credentials | |
| Provides username, password, and SSL configuration. More... | |
| __EventListener | |
| Handles open, close, message, and error events. More... | |
| __Nonce | |
| Base64-encoded 16-byte random value provided to the server for validation. More... | |
| __Protocol | |
| The actual protocol in use (Sec-WebSocket-Protocol response header) More... | |
| __Request | |
| The HTTP request, wrapping use of the device used for communcation. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from RegisteredObject | |
| CAPTION = None | |
| Optional name used by the Form Wizard for a class when generating forms. More... | |
| JAVATYPE = None | |
| The Java type to be used when exported. | |
| PROPERTYVALIDATION = None | |
| This parameter controls the default validation behavior for the object. More... | |
Implements a WebSocket client.
Usage:
| _.Library.Boolean Next | ( | _.Library.Integer | pTimeout, |
| _.Library.Boolean | pTimedOut | ||
| ) |
Waits for data from the server.
Returns 1 if the connection remains open, and 0 if the connection is closed or an error occurs.
The event listener will be notified upon receiving a message, or if the connection is closed or an error occurs.
@Argument pTimeout Timeout (in seconds) to wait to receive a message from the server. @Argument pTimedOut True if the read operation timed out.
| _.Library.Status Ping | ( | _.Library.String | pMessage, |
| _.Library.Integer | pTimeout | ||
| ) |
Sends a ping frame to the server.
Returns $$$NetWebSocketErrPingTimeout if the ping times out
Returns $$$NetWebSocketErrPongInvalid if the pong response is not equal to pMessage
Otherwise, returns $$$OK @Argument pMessage Message to send with the ping @Argument pFragmentSize Timeout (in seconds) to wait to receive a "pong" back from the server.
| _.Library.Status Pong | ( | _.Library.String | pMessage | ) |
Sends an unsolicited pong frame to the server.
@Argument pMessage Message to send with the pong
| _.Library.Status Send | ( | pContent, | |
| _.Library.Integer | pFragmentSize | ||
| ) |
Sends a binary or character stream, dynamic object, or string to the server.
@Argument pContent Binary or character stream, dynamic object, or string to the server. @Argument pFragmentSize Maximum size (in bytes) to send in a single frame; 0 indicates no maximum.
|
private |
Accepted protocols (Sec-WebSocket-Protocol request header)
|
private |
Provides username, password, and SSL configuration.
|
private |
Handles open, close, message, and error events.
|
private |
Base64-encoded 16-byte random value provided to the server for validation.
|
private |
The actual protocol in use (Sec-WebSocket-Protocol response header)
|
private |
The HTTP request, wrapping use of the device used for communcation.
| URL |
WebSocket endpoint.