Implements a web socket client interface.
Constructors and accessors
Other related reference items
Related help topics
close ( self )Closes the web socket.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
poll ( self ) : stingray.WebSocket.MessageType?, string?Polls the WebSocket for new data.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
The type of the returned payload, TEXT or BINARY. If there is no new data, nil is returned. The ? notation indicates that this type is optional: there may be zero or one instances of it. | |
string? |
The payload of the message or nil if there was no new data. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
send ( self, msg, type )Sends a websocket message.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
msg : | string | The string to send over the websocket. |
type : | The type of the message, TEXT or BINARY. This defaults to TEXT unless specified. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
state ( self ) : stingray.WebSocket.StateReturns the current state of the web socket.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
The current state of the web socket. |