\hypertarget{group__wsstatus}{}\section{Websocket status A\+P\+Is} \label{group__wsstatus}\index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsection*{Functions} \begin{DoxyCompactItemize} \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__wsstatus_ga2bb3655329b4651cd06f79ee3a764421}{lws\+\_\+send\+\_\+pipe\+\_\+choked} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__wsstatus_ga08e9ee165fca503fd9427d55cfecac37}{lws\+\_\+is\+\_\+final\+\_\+fragment} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN unsigned char \hyperlink{group__wsstatus_ga3df5045656dfb6b0e63a38de2dca79d2}{lws\+\_\+get\+\_\+reserved\+\_\+bits} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__wsstatus_gaeca4afc94b1f026034f99cbba37e2f85}{lws\+\_\+partial\+\_\+buffered} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__wsstatus_gaccd9c59336efad8af0554f79cc5966fd}{lws\+\_\+frame\+\_\+is\+\_\+binary} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__wsstatus_ga26a140623d202dd2bf2004deb6994baa}{lws\+\_\+is\+\_\+ssl} (struct lws $\ast$wsi) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__wsstatus_ga4ad226d5e01024b4046f4a5a37199aa1}{lws\+\_\+is\+\_\+cgi} (struct lws $\ast$wsi) \end{DoxyCompactItemize} \subsection{Detailed Description} \subsubsection*{Websocket connection status A\+P\+Is} These provide information about ws connection or message status \subsection{Function Documentation} \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+frame\+\_\+is\+\_\+binary@{lws\+\_\+frame\+\_\+is\+\_\+binary}} \index{lws\+\_\+frame\+\_\+is\+\_\+binary@{lws\+\_\+frame\+\_\+is\+\_\+binary}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+frame\+\_\+is\+\_\+binary(struct lws $\ast$wsi)}{lws\_frame\_is\_binary(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+frame\+\_\+is\+\_\+binary ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_gaccd9c59336efad8af0554f79cc5966fd}{}\label{group__wsstatus_gaccd9c59336efad8af0554f79cc5966fd} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_gaccd9c59336efad8af0554f79cc5966fd}{lws\+\_\+frame\+\_\+is\+\_\+binary()}\+: true if the current frame was sent in binary mode \begin{DoxyParams}{Parameters} {\em wsi} & the connection we are inquiring about\\ \hline \end{DoxyParams} This is intended to be called from the L\+W\+S\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+\+R\+E\+C\+E\+I\+VE callback if it\textquotesingle{}s interested to see if the frame it\textquotesingle{}s dealing with was sent in binary mode. \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+get\+\_\+reserved\+\_\+bits@{lws\+\_\+get\+\_\+reserved\+\_\+bits}} \index{lws\+\_\+get\+\_\+reserved\+\_\+bits@{lws\+\_\+get\+\_\+reserved\+\_\+bits}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+get\+\_\+reserved\+\_\+bits(struct lws $\ast$wsi)}{lws\_get\_reserved\_bits(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN unsigned char lws\+\_\+get\+\_\+reserved\+\_\+bits ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_ga3df5045656dfb6b0e63a38de2dca79d2}{}\label{group__wsstatus_ga3df5045656dfb6b0e63a38de2dca79d2} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_ga3df5045656dfb6b0e63a38de2dca79d2}{lws\+\_\+get\+\_\+reserved\+\_\+bits()} -\/ access reserved bits of ws frame \begin{DoxyParams}{Parameters} {\em wsi} & lws connection \\ \hline \end{DoxyParams} \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+is\+\_\+cgi@{lws\+\_\+is\+\_\+cgi}} \index{lws\+\_\+is\+\_\+cgi@{lws\+\_\+is\+\_\+cgi}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+is\+\_\+cgi(struct lws $\ast$wsi)}{lws\_is\_cgi(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+is\+\_\+cgi ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_ga4ad226d5e01024b4046f4a5a37199aa1}{}\label{group__wsstatus_ga4ad226d5e01024b4046f4a5a37199aa1} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_ga4ad226d5e01024b4046f4a5a37199aa1}{lws\+\_\+is\+\_\+cgi()} -\/ find out if this wsi is running a cgi process \begin{DoxyParams}{Parameters} {\em wsi} & lws connection \\ \hline \end{DoxyParams} \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+is\+\_\+final\+\_\+fragment@{lws\+\_\+is\+\_\+final\+\_\+fragment}} \index{lws\+\_\+is\+\_\+final\+\_\+fragment@{lws\+\_\+is\+\_\+final\+\_\+fragment}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+is\+\_\+final\+\_\+fragment(struct lws $\ast$wsi)}{lws\_is\_final\_fragment(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+is\+\_\+final\+\_\+fragment ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_ga08e9ee165fca503fd9427d55cfecac37}{}\label{group__wsstatus_ga08e9ee165fca503fd9427d55cfecac37} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_ga08e9ee165fca503fd9427d55cfecac37}{lws\+\_\+is\+\_\+final\+\_\+fragment()} -\/ tests if last part of ws message \begin{DoxyParams}{Parameters} {\em wsi} & lws connection \\ \hline \end{DoxyParams} \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+is\+\_\+ssl@{lws\+\_\+is\+\_\+ssl}} \index{lws\+\_\+is\+\_\+ssl@{lws\+\_\+is\+\_\+ssl}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+is\+\_\+ssl(struct lws $\ast$wsi)}{lws\_is\_ssl(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+is\+\_\+ssl ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_ga26a140623d202dd2bf2004deb6994baa}{}\label{group__wsstatus_ga26a140623d202dd2bf2004deb6994baa} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_ga26a140623d202dd2bf2004deb6994baa}{lws\+\_\+is\+\_\+ssl()} -\/ Find out if connection is using S\+SL \begin{DoxyParams}{Parameters} {\em wsi} & websocket connection to check \begin{DoxyVerb} Returns 0 if the connection is not using SSL, 1 if using SSL and using verified cert, and 2 if using SSL but the cert was not checked (appears for client wsi told to skip check on connection)\end{DoxyVerb} \\ \hline \end{DoxyParams} \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+partial\+\_\+buffered@{lws\+\_\+partial\+\_\+buffered}} \index{lws\+\_\+partial\+\_\+buffered@{lws\+\_\+partial\+\_\+buffered}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+partial\+\_\+buffered(struct lws $\ast$wsi)}{lws\_partial\_buffered(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+partial\+\_\+buffered ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_gaeca4afc94b1f026034f99cbba37e2f85}{}\label{group__wsstatus_gaeca4afc94b1f026034f99cbba37e2f85} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_gaeca4afc94b1f026034f99cbba37e2f85}{lws\+\_\+partial\+\_\+buffered()} -\/ find out if lws buffered the last write \begin{DoxyParams}{Parameters} {\em wsi} & websocket connection to check\\ \hline \end{DoxyParams} Returns 1 if you cannot use lws\+\_\+write because the last write on this connection is still buffered, and can\textquotesingle{}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 W\+R\+I\+T\+E\+A\+B\+LE 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. \index{Websocket status A\+P\+Is@{Websocket status A\+P\+Is}!lws\+\_\+send\+\_\+pipe\+\_\+choked@{lws\+\_\+send\+\_\+pipe\+\_\+choked}} \index{lws\+\_\+send\+\_\+pipe\+\_\+choked@{lws\+\_\+send\+\_\+pipe\+\_\+choked}!Websocket status A\+P\+Is@{Websocket status A\+P\+Is}} \subsubsection[{\texorpdfstring{lws\+\_\+send\+\_\+pipe\+\_\+choked(struct lws $\ast$wsi)}{lws\_send\_pipe\_choked(struct lws *wsi)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+send\+\_\+pipe\+\_\+choked ( \begin{DoxyParamCaption} \item[{struct lws $\ast$}]{wsi} \end{DoxyParamCaption} )}\hypertarget{group__wsstatus_ga2bb3655329b4651cd06f79ee3a764421}{}\label{group__wsstatus_ga2bb3655329b4651cd06f79ee3a764421} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__wsstatus_ga2bb3655329b4651cd06f79ee3a764421}{lws\+\_\+send\+\_\+pipe\+\_\+choked()} -\/ tests if socket is writable or not \begin{DoxyParams}{Parameters} {\em wsi} & lws connection\\ \hline \end{DoxyParams} Allows you to check if you can write more on the socket