ThingWorx C SDK
|
Websocket entity structure definition. More...
#include <twWebsocket.h>
Public Attributes | |
struct twTlsClient * | connection |
uint32_t | messageChunkSize |
int32_t | bytesNeeded |
char | read_state |
char | previous_read_state |
uint16_t | frameSize |
char * | frameBuffer |
char * | frameBufferPtr |
unsigned char | ws_header [64] |
unsigned char * | headerPtr |
twStream * | multiframeRecvStream |
char * | host |
uint16_t | port |
twPasswdCallbackFunction | api_key_callback |
char * | gatewayName |
char * | gatewayType |
unsigned char * | security_key |
uint32_t | sessionId |
char * | resource |
TW_MUTEX | sendMessageMutex |
TW_MUTEX | sendFrameMutex |
TW_MUTEX | recvMutex |
signed char | connect_state |
signed char | isConnected |
ws_cb | on_ws_connected |
ws_binary_data_cb | on_ws_binaryMessage |
ws_data_cb | on_ws_textMessage |
ws_data_cb | on_ws_ping |
ws_data_cb | on_ws_pong |
ws_data_cb | on_ws_close |
z_stream | defstream |
char | bDeflateInitialized |
TW_MUTEX | compressionMutex |
z_stream | inflstream |
char | bInflateInitialized |
TW_MUTEX | decompressionMutex |
char | bCompressedMsg |
char | bSupportsPermessageDeflate |
char | bDisableCompression |
Websocket entity structure definition.
char twWs::bCompressedMsg |
Lock for ZLib deflate context
char twWs::bDeflateInitialized |
ZLib deflate stream.
char twWs::bDisableCompression |
True if the server supports Permessage-Deflate (after Upgrade negotiations)
char twWs::bInflateInitialized |
ZLib inflate stream.
char twWs::bSupportsPermessageDeflate |
True when the message being received is a compressed message (text and binary messages). If the message is fragmented, this state is preserved across receipt of the continuation frames (which aren't marked as compressed), and also across receipt of interleaved control frames (which are themselves never compressed).
int32_t twWs::bytesNeeded |
How many bytes we should read next.
TW_MUTEX twWs::compressionMutex |
State of ZLib deflate context
signed char twWs::connect_state |
The connection state of the websocket.
struct twTlsClient* twWs::connection |
Pointer to a TLS client connection structure.
TW_MUTEX twWs::decompressionMutex |
State of ZLib inflate context
char* twWs::frameBuffer |
Pointer to a frame buffer.
char* twWs::frameBufferPtr |
A pointer to the websocket's frame buffer.
uint16_t twWs::frameSize |
Used to remember the previous read state if a continuation op code is received Max size of a websocket frame (not to be confused with max ThingWorx message size .
char* twWs::gatewayName |
This is a pointer to a function which will be called whenever the client must provide an application key for authentication. You must implement this function and pass a pointer to it to initialize the API. This function must be of type twPasswdCallbackFunction and should have a format like the one shown below.
myPasswordCallback(char* passwdBuffer,unsigned int maxPasswordLength);
The implementation of this function must fill passwdBuffer with the current application key. < The API key that will be used during an ensuing authentication process. An optional name if the SDK is being used to develop a gateway application which allows multiple Things to connect through it. If not NULL this is used during the binding process.
char* twWs::gatewayType |
An optional type if the SDK is being used to develop a gateway application which allows multiple Things to connect through it. If not NULL this is used during the binding process.
unsigned char* twWs::headerPtr |
Pointer to a the header buffer.
char* twWs::host |
The host name of the websocket server.
z_stream twWs::inflstream |
Lock for ZLib deflate context
signed char twWs::isConnected |
TRUE signifies the websocket is connected.
uint32_t twWs::messageChunkSize |
Max size (in bytes) of multipart message chunk.
twStream* twWs::multiframeRecvStream |
Stream containing the concatenated payloads of a fragmented WS msg; only present during a fragmented recv.
ws_binary_data_cb twWs::on_ws_binaryMessage |
Pointer to a callback function registered to be called when a complete binary message is received.
ws_data_cb twWs::on_ws_close |
Pointer to a callback function registered to be called when the server closes the websocket connection.
ws_cb twWs::on_ws_connected |
Pointer to a callback function registered to be called when the websocket connection is successfully established.
ws_data_cb twWs::on_ws_ping |
Pointer to a callback function registered to be called when a Ping is received.
ws_data_cb twWs::on_ws_pong |
Pointer to a callback function registered to be called when a Pong is received.
ws_data_cb twWs::on_ws_textMessage |
Pointer to a callback function registered to be called when a complete text message is received.
uint16_t twWs::port |
The port that the websocket server is listening on.
char twWs::read_state |
READ_HEADER or READ_BODY.
TW_MUTEX twWs::recvMutex |
A mutex for receiving data.
char* twWs::resource |
The HTTP resource of the connection.
unsigned char* twWs::security_key |
websocket security key.
TW_MUTEX twWs::sendFrameMutex |
A mutex for sending frames.
TW_MUTEX twWs::sendMessageMutex |
A mutex for sending messages.
uint32_t twWs::sessionId |
Unique session ID.
unsigned char twWs::ws_header[64] |
A buffer to receive websocket frame headers.