Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kWebSocket_Send ( kWebSocket  webSocket)

Sends any buffered data and ends the current message.

Websocket communication consists of messages, where each message can be transmitted in one or more frames.

The kStream_Write method can be used to write data to a WebSocket. If the WebSocket has a client buffer and the buffer is filled, the buffered data will be sent as a WebSocket frame. If the WebSocket does not have a client buffer, each call to kStream_Write will generate a WebSocket frame.

The kWebSocket_Send method generates an end-of-message frame that includes any data remaining in the WebSocket buffer. If no data remains, an empty end-of-message frame will be generated. All message data is flushed to the underlying TCP object as part of kWebSocket_Send; the kStream_Flush method has no effect.

Parameters
webSocketWebSocket object.
Returns
Operation status.