SharkSSL™ Embedded SSL/TLS Stack
|
38 #ifndef _WsClientLib_h
39 #define _WsClientLib_h
67 #define WSOP_Text 0x81
69 #define WSOP_Binary 0x82
71 #define WSOP_Close 0x88
73 #define WSOP_Ping 0x89
75 #define WSOP_Pong 0x8A
150 const char* path,
const char* origin);
WebSocket Client State Information, initialize using: WscState wss={0}; however, several members must...
Definition: WsClientLib.h:85
int sendBufLen
The send buffer length must be set to the sendBuf length.
Definition: WsClientLib.h:94
SOCKET * sock
The SOCKET object must be set.
Definition: WsClientLib.h:99
int wscProtocolHandshake(WscState *wss, U32 tmo, const char *host, const char *path, const char *origin)
Upgrades (morphs) an HTTPS request/response pair to a WebSocket connection.
struct SharkSslCon SharkSslCon
SharkSslCon is an opaque handle returned by function SharkSsl_createCon.
Definition: SharkSSL.h:534
U8 isTimeout
Set when the read function returns due to a timeout.
Definition: WsClientLib.h:113
int wscSendBin(WscState *wss, U8 *buf, int len)
Sends binary data to server.
int wscClose(WscState *wss, int statusCode)
Sends a WebSocket close control frame to the server and closes the connection.
int frameLen
The WebSocket frame length.
Definition: WsClientLib.h:101
int recBufLen
The receive buffer length must be set to the recBuf length.
Definition: WsClientLib.h:92
int wscRead(WscState *wss, U8 **buf, U32 timeout)
Wait for WebSocket frames sent by the server.
#define SOCKET
Infinite wait time option for socket read functions.
Definition: selib.h:102
SharkSslCon * scon
The SharkSslCon object must be set when using secure mode.
Definition: WsClientLib.h:97
int bytesRead
Read frame data until: frameLen - bytesRead = 0.
Definition: WsClientLib.h:103
U8 * sendBuf
The send buffer must be set when not in secure mode.
Definition: WsClientLib.h:90
int wscSendCtrl(WscState *wss, U8 opCode, const U8 *buf, int len)
Sends a WebSocket control frame.
U8 * recBuf
The receive buffer must be set when not in secure mode.
Definition: WsClientLib.h:88