1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00
libwebsockets/doc/latex/group__wsclose.tex

133 lines
21 KiB
TeX

\hypertarget{group__wsclose}{}\section{Websocket Close}
\label{group__wsclose}\index{Websocket Close@{Websocket Close}}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item
enum \hyperlink{group__wsclose_gae399c571df32ba532c0ca67da9284985}{lws\+\_\+close\+\_\+status} \{ \\*
{\bfseries L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+S\+T\+A\+T\+US} = 0,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a3ffa38d5081b85fb739e02a747ccf2c4}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL} = 1000,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a9737a68759e739856b150ff9dfa30218}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY} = 1001,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a1bb501d212fa4d57053db681b1dfab98}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR} = 1002,
\\*
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a462c99b05459df700919cfd3f53c8276}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE} = 1003,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985af90cb98d983ad3d4c79df9b6f3d4a4d2}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED} = 1004,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a4b8a3b7ce6f731e5248e4b0fb64a5044}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US} = 1005,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a68b3d34bebd88547dcfa5cadba0acd6c}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE} = 1006,
\\*
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a7aef2da0062da606eeb35aaca5cf9050}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD} = 1007,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad09e68295eabdddcba4e332fbea70ae5}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON} = 1008,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a2e1f0113494a58e762eed3d22e7080d8}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE} = 1009,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ac6a161822783ee873be1c66f48d14e0e}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED} = 1010,
\\*
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad0869604d79e13700ae5d196a431b350}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON} = 1011,
\hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad2b477a91c8445bf34ecd43977f9b390}{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE} = 1015,
{\bfseries L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+S\+T\+A\+T\+U\+S\+\_\+\+C\+O\+N\+T\+E\+X\+T\+\_\+\+D\+E\+S\+T\+R\+OY} = 9999
\}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN void \hyperlink{group__wsclose_gaa1c863415d1783cd8de7938aa6efa262}{lws\+\_\+close\+\_\+reason} (struct lws $\ast$wsi, enum \hyperlink{group__wsclose_gae399c571df32ba532c0ca67da9284985}{lws\+\_\+close\+\_\+status} status, unsigned char $\ast$buf, size\+\_\+t len)
\end{DoxyCompactItemize}
\subsection{Detailed Description}
\subsubsection*{Websocket close frame control}
When we close a ws connection, we can send a reason code and a short U\+T\+F-\/8 description back with the close packet.
\subsection{Enumeration Type Documentation}
\index{Websocket Close@{Websocket Close}!lws\+\_\+close\+\_\+status@{lws\+\_\+close\+\_\+status}}
\index{lws\+\_\+close\+\_\+status@{lws\+\_\+close\+\_\+status}!Websocket Close@{Websocket Close}}
\subsubsection[{\texorpdfstring{lws\+\_\+close\+\_\+status}{lws\_close\_status}}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lws\+\_\+close\+\_\+status}}\hypertarget{group__wsclose_gae399c571df32ba532c0ca67da9284985}{}\label{group__wsclose_gae399c571df32ba532c0ca67da9284985}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
enum lws\+\_\+close\+\_\+status -\/ R\+F\+C6455 close status codes \begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+R\+M\+AL\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a3ffa38d5081b85fb739e02a747ccf2c4}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a3ffa38d5081b85fb739e02a747ccf2c4}
}]1000 indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+G\+O\+I\+N\+G\+A\+W\+AY\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a9737a68759e739856b150ff9dfa30218}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a9737a68759e739856b150ff9dfa30218}
}]1001 indicates that an endpoint is \char`\"{}going away\char`\"{}, such as a server going down or a browser having navigated away from a page. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+R\+O\+T\+O\+C\+O\+L\+\_\+\+E\+RR\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a1bb501d212fa4d57053db681b1dfab98}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a1bb501d212fa4d57053db681b1dfab98}
}]1002 indicates that an endpoint is terminating the connection due to a protocol error. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+A\+C\+C\+E\+P\+T\+A\+B\+L\+E\+\_\+\+O\+P\+C\+O\+DE\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a462c99b05459df700919cfd3f53c8276}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a462c99b05459df700919cfd3f53c8276}
}]1003 indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.\+g., an endpoint that understands only text data M\+AY send this if it receives a binary message). \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+R\+E\+S\+E\+R\+V\+ED\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985af90cb98d983ad3d4c79df9b6f3d4a4d2}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985af90cb98d983ad3d4c79df9b6f3d4a4d2}
}]Reserved. The specific meaning might be defined in the future. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+N\+O\+\_\+\+S\+T\+A\+T\+US\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a4b8a3b7ce6f731e5248e4b0fb64a5044}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a4b8a3b7ce6f731e5248e4b0fb64a5044}
}]1005 is a reserved value and M\+U\+ST N\+OT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that no status code was actually present. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+A\+B\+N\+O\+R\+M\+A\+L\+\_\+\+C\+L\+O\+SE\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a68b3d34bebd88547dcfa5cadba0acd6c}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a68b3d34bebd88547dcfa5cadba0acd6c}
}]1006 is a reserved value and M\+U\+ST N\+OT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.\+g., without sending or receiving a Close control frame. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+Y\+L\+O\+AD\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a7aef2da0062da606eeb35aaca5cf9050}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a7aef2da0062da606eeb35aaca5cf9050}
}]1007 indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.\+g., non-\/\+U\+T\+F-\/8 \mbox{[}R\+F\+C3629\mbox{]} data within a text message). \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+P\+O\+L\+I\+C\+Y\+\_\+\+V\+I\+O\+L\+A\+T\+I\+ON\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad09e68295eabdddcba4e332fbea70ae5}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad09e68295eabdddcba4e332fbea70ae5}
}]1008 indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.\+g., 1003 or 1009) or if there is a need to hide specific details about the policy. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+T\+O\+O\+\_\+\+L\+A\+R\+GE\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985a2e1f0113494a58e762eed3d22e7080d8}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985a2e1f0113494a58e762eed3d22e7080d8}
}]1009 indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+E\+X\+T\+E\+N\+S\+I\+O\+N\+\_\+\+R\+E\+Q\+U\+I\+R\+ED\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985ac6a161822783ee873be1c66f48d14e0e}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985ac6a161822783ee873be1c66f48d14e0e}
}]1010 indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn\textquotesingle{}t return them in the response message of the Web\+Socket handshake. The list of extensions that are needed S\+H\+O\+U\+LD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the Web\+Socket handshake instead \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+E\+X\+P\+E\+C\+T\+E\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+ON\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad0869604d79e13700ae5d196a431b350}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad0869604d79e13700ae5d196a431b350}
}]1011 indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request. \index{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE}!Websocket Close@{Websocket Close}}\index{Websocket Close@{Websocket Close}!L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE@{L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE}}\item[{\em
L\+W\+S\+\_\+\+C\+L\+O\+S\+E\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T\+L\+S\+\_\+\+F\+A\+I\+L\+U\+RE\hypertarget{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad2b477a91c8445bf34ecd43977f9b390}{}\label{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad2b477a91c8445bf34ecd43977f9b390}
}]1015 is a reserved value and M\+U\+ST N\+OT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a T\+LS handshake (e.\+g., the server certificate can\textquotesingle{}t be verified). \end{description}
\end{Desc}
\begin{DoxyCode}
467 \{
468 LWS\_CLOSE\_STATUS\_NOSTATUS = 0,
469 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a3ffa38d5081b85fb739e02a747ccf2c4}{LWS\_CLOSE\_STATUS\_NORMAL} = 1000,
472 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a9737a68759e739856b150ff9dfa30218}{LWS\_CLOSE\_STATUS\_GOINGAWAY} = 1001,
475 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a1bb501d212fa4d57053db681b1dfab98}{LWS\_CLOSE\_STATUS\_PROTOCOL\_ERR} = 1002,
478 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a462c99b05459df700919cfd3f53c8276}{LWS\_CLOSE\_STATUS\_UNACCEPTABLE\_OPCODE} =
1003,
483 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985af90cb98d983ad3d4c79df9b6f3d4a4d2}{LWS\_CLOSE\_STATUS\_RESERVED} = 1004,
485 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a4b8a3b7ce6f731e5248e4b0fb64a5044}{LWS\_CLOSE\_STATUS\_NO\_STATUS} = 1005,
490 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a68b3d34bebd88547dcfa5cadba0acd6c}{LWS\_CLOSE\_STATUS\_ABNORMAL\_CLOSE} = 1006,
496 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a7aef2da0062da606eeb35aaca5cf9050}{LWS\_CLOSE\_STATUS\_INVALID\_PAYLOAD} = 1007,
501 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad09e68295eabdddcba4e332fbea70ae5}{LWS\_CLOSE\_STATUS\_POLICY\_VIOLATION} = 1008,
507 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985a2e1f0113494a58e762eed3d22e7080d8}{LWS\_CLOSE\_STATUS\_MESSAGE\_TOO\_LARGE} = 1009,
511 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ac6a161822783ee873be1c66f48d14e0e}{LWS\_CLOSE\_STATUS\_EXTENSION\_REQUIRED} = 1010,
519 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad0869604d79e13700ae5d196a431b350}{LWS\_CLOSE\_STATUS\_UNEXPECTED\_CONDITION} =
1011,
523 \hyperlink{group__wsclose_ggae399c571df32ba532c0ca67da9284985ad2b477a91c8445bf34ecd43977f9b390}{LWS\_CLOSE\_STATUS\_TLS\_FAILURE} = 1015,
530 \textcolor{comment}{/****** add new things just above ---^ ******/}
531
532 LWS\_CLOSE\_STATUS\_NOSTATUS\_CONTEXT\_DESTROY = 9999,
533 \};
\end{DoxyCode}
\subsection{Function Documentation}
\index{Websocket Close@{Websocket Close}!lws\+\_\+close\+\_\+reason@{lws\+\_\+close\+\_\+reason}}
\index{lws\+\_\+close\+\_\+reason@{lws\+\_\+close\+\_\+reason}!Websocket Close@{Websocket Close}}
\subsubsection[{\texorpdfstring{lws\+\_\+close\+\_\+reason(struct lws $\ast$wsi, enum lws\+\_\+close\+\_\+status status, unsigned char $\ast$buf, size\+\_\+t len)}{lws\_close\_reason(struct lws *wsi, enum lws\_close\_status status, unsigned char *buf, size\_t len)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN void lws\+\_\+close\+\_\+reason (
\begin{DoxyParamCaption}
\item[{struct lws $\ast$}]{wsi, }
\item[{enum {\bf lws\+\_\+close\+\_\+status}}]{status, }
\item[{unsigned char $\ast$}]{buf, }
\item[{size\+\_\+t}]{len}
\end{DoxyParamCaption}
)}\hypertarget{group__wsclose_gaa1c863415d1783cd8de7938aa6efa262}{}\label{group__wsclose_gaa1c863415d1783cd8de7938aa6efa262}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
lws\+\_\+close\+\_\+reason -\/ Set reason and aux data to send with Close packet If you are going to return nonzero from the callback requesting the connection to close, you can optionally call this to set the reason the peer will be told if possible.
\begin{DoxyParams}{Parameters}
{\em wsi} & The websocket connection to set the close reason on \\
\hline
{\em status} & A valid close status from websocket standard \\
\hline
{\em buf} & N\+U\+LL or buffer containing up to 124 bytes of auxiliary data \\
\hline
{\em len} & Length of data in \\
\hline
{\em buf} & to send \\
\hline
\end{DoxyParams}