websocket#
Tutorials#
Variables#
const WebsocketState |
|
const bool |
|
const WebsocketType |
|
char32 |
Constructors#
Functions#
Enumerations#
WebsocketState WEBSOCKET_STATE_CONNECTING = 0L
WebsocketState WEBSOCKET_STATE_OPEN = 1L
WebsocketState WEBSOCKET_STATE_CLOSING = 2L
WebsocketState WEBSOCKET_STATE_CLOSED = 3L
WebsocketType WEBSOCKET_MESSAGE_TYPE_TEXT = 1L
send text data
WebsocketType WEBSOCKET_MESSAGE_TYPE_BINARY = 2L
send binary data
Variable descriptions#
const WebsocketState State 🔗 Source
Current state of the websocket.
const bool HasMessage 🔗 Source
True if there is a message waiting to be received.
const WebsocketType MessageType 🔗 Source
Constructor descriptions#
Function descriptions#
void GetError(char32[] buf) 🔗 Source
Gets the current websocket error message (if any).
void Send(char32[] buf, WebsocketType type = WEBSOCKET_MESSAGE_TYPE_TEXT
) 🔗 Source
Sends a message over the websocket.
If HasMessage is true, returns a pointer to the websocket’s internal data array representing the next message in the queue. If there is no message, returns NULL.
Calling this function again will overwrite the contents of this array.
The array is destroyed automatically when the websocket is freed.
DEPRECATED: This no longer does anything - objects are freed automatically now.
See “Object Memory Management” section
This will deallocate the websocket pointer, so that the pointer ID may be re-used.
There is a limit to how many websocket pointers may be allocated at once, so be sure to free them when you are no longer using them.
Warning
Deprecated! Free() no longer does anything as of ZC 3.0. Objects are now freed automatically.
Grants ‘Ownership’ of the pointer to the currently running script.
*pre-3.0*: When the script terminates (at the same time any Local Arrays in the script are cleared), the pointer will be automatically freed.
See “Object Memory Management” section