libwebsockets
Lightweight C library for HTML5 websockets
|
Functions | |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT | lws_send_pipe_choked (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN int | lws_is_final_fragment (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN int | lws_is_first_fragment (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN unsigned char | lws_get_reserved_bits (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN uint8_t | lws_get_opcode (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT | lws_partial_buffered (struct lws *wsi) |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT | lws_frame_is_binary (struct lws *wsi) |
These provide information about ws connection or message status
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_send_pipe_choked | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_send_pipe_choked() - tests if socket is writable or not
wsi | lws connection |
Allows you to check if you can write more on the socket
LWS_VISIBLE LWS_EXTERN int lws_is_final_fragment | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_is_final_fragment() - tests if last part of ws message
wsi | lws connection |
LWS_VISIBLE LWS_EXTERN int lws_is_first_fragment | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_is_first_fragment() - tests if first part of ws message
wsi | lws connection |
LWS_VISIBLE LWS_EXTERN unsigned char lws_get_reserved_bits | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_get_reserved_bits() - access reserved bits of ws frame
wsi | lws connection |
LWS_VISIBLE LWS_EXTERN uint8_t lws_get_opcode | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_get_opcode() - access opcode of ws frame
wsi | lws connection |
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_partial_buffered | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_partial_buffered() - find out if lws buffered the last write
wsi | websocket connection to check |
Returns 1 if you cannot use lws_write because the last write on this connection is still buffered, and can't be cleared without returning to the service loop and waiting for the connection to be writeable again.
If you will try to do >1 lws_write call inside a single WRITEABLE callback, you must check this after every write and bail if set, ask for a new writeable callback and continue writing from there.
This is never set at the start of a writeable callback, but any write may set it.
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_frame_is_binary | ( | struct lws * | wsi | ) |
#include <include/libwebsockets/lws-ws-state.h>
lws_frame_is_binary(): true if the current frame was sent in binary mode
wsi | the connection we are inquiring about |
This is intended to be called from the LWS_CALLBACK_RECEIVE callback if it's interested to see if the frame it's dealing with was sent in binary mode.