Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1759435683, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"92efd6f79f0f5246e36bc2ec93c513f6", "oid":{ "oid": "8fdff1053cd2d11e7ec1a4c50b308b7507724d8f", "alias": []},"blobname": "doc/latex/group__sending-data.tex", "blob": "\u005chypertarget{group__sending-data}{}\u005csection{Sending data}\n\u005clabel{group__sending-data}\u005cindex{Sending data@{Sending data}}\n\u005csubsection*{Enumerations}\n\u005cbegin{DoxyCompactItemize}\n\u005citem \nenum \u005chyperlink{group__sending-data_ga98b099cf8c1c7e38ad78501f270e193d}{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol} \u005c{ \u005c\u005c*\n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da80e8f169fda236c56bfb795ed62903db}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT} \u003d 0, \n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193daf6486c0dba50c44198100717721d9ab2}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY} \u003d 1, \n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da10047eb05b5e1c298151dc47a5b44826}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON} \u003d 2, \n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dabb6705e1d1327cdda5025be28f07712e}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP} \u003d 3, \n\u005c\u005c*\n{\u005cbfseries L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+P\u005c+I\u005c+NG} \u003d 5, \n{\u005cbfseries L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+P\u005c+O\u005c+NG} \u003d 6, \n{\u005cbfseries L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+F\u005c+I\u005c+N\u005c+AL} \u003d 7, \n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dafe5a38e940ce56708ac814627e9c0917}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS} \u003d 8, \n\u005c\u005c*\n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da115440f272a5d55518adfc8099acfee3}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN} \u003d 0x40, \n\u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da220d8e8652d9b97fb66e476e2a60ffce}{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK} \u003d 0x80\n \u005c}\n\u005cend{DoxyCompactItemize}\n\u005csubsection*{Functions}\n\u005cbegin{DoxyCompactItemize}\n\u005citem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+V\u005c+I\u005c+S\u005c+I\u005c+B\u005c+LE L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+E\u005c+X\u005c+T\u005c+E\u005c+RN int \u005chyperlink{group__sending-data_gafd5fdd285a0e25ba7e3e1051deec1001}{lws\u005c+\u005c_\u005c+write} (struct lws $\u005cast$wsi, unsigned char $\u005cast$buf, size\u005c+\u005c_\u005c+t len, enum \u005chyperlink{group__sending-data_ga98b099cf8c1c7e38ad78501f270e193d}{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol} protocol)\n\u005cend{DoxyCompactItemize}\n\n\n\u005csubsection{Detailed Description}\nA\u005c+P\u005c+Is related to writing data on a connection \n\n\u005csubsection{Enumeration Type Documentation}\n\u005cindex{Sending data@{Sending data}!lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol@{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol}}\n\u005cindex{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol@{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol}!Sending data@{Sending data}}\n\u005csubsubsection[{\u005ctexorpdfstring{lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol}{lws\u005c_write\u005c_protocol}}]{\u005csetlength{\u005crightskip}{0pt plus 5cm}enum {\u005cbf lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol}}\u005chypertarget{group__sending-data_ga98b099cf8c1c7e38ad78501f270e193d}{}\u005clabel{group__sending-data_ga98b099cf8c1c7e38ad78501f270e193d}\n\n\n{\u005cttfamily \u005c#include $\u003c$\u005chyperlink{libwebsockets_8h}{lib/libwebsockets.\u005c+h}$\u003e$}\n\n\u005cbegin{Desc}\n\u005citem[Enumerator]\u005cpar\n\u005cbegin{description}\n\u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da80e8f169fda236c56bfb795ed62903db}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da80e8f169fda236c56bfb795ed62903db}\n}]Send a ws T\u005c+E\u005c+XT message,the pointer must have L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE valid memory behind it. The receiver expects only valid utf-\u005c/8 in the payload \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193daf6486c0dba50c44198100717721d9ab2}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193daf6486c0dba50c44198100717721d9ab2}\n}]Send a ws B\u005c+I\u005c+N\u005c+A\u005c+RY message, the pointer must have L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE valid memory behind it. Any sequence of bytes is valid \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da10047eb05b5e1c298151dc47a5b44826}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da10047eb05b5e1c298151dc47a5b44826}\n}]Continue a previous ws message, the pointer must have L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE valid memory behind it \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dabb6705e1d1327cdda5025be28f07712e}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dabb6705e1d1327cdda5025be28f07712e}\n}]Send H\u005c+T\u005c+TP content \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dafe5a38e940ce56708ac814627e9c0917}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dafe5a38e940ce56708ac814627e9c0917}\n}]Send http headers (http2 encodes this payload and L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP payload differently, http 1.\u005c+x links also handle this correctly. so to be compatible with both in the future,header response part should be sent using this regardless of http version expected) \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+N\u005c+O\u005c+\u005c_\u005c+\u005c+F\u005c+IN\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da115440f272a5d55518adfc8099acfee3}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da115440f272a5d55518adfc8099acfee3}\n}]This part of the message is not the end of the message \u005cindex{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK}!Sending data@{Sending data}}\u005cindex{Sending data@{Sending data}!L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK@{L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK}}\u005citem[{\u005cem \nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+L\u005c+I\u005c+E\u005c+N\u005c+T\u005c+\u005c_\u005c+\u005c+I\u005c+G\u005c+N\u005c+O\u005c+R\u005c+E\u005c+\u005c_\u005c+\u005c+X\u005c+O\u005c+R\u005c+\u005c_\u005c+\u005c+M\u005c+A\u005c+SK\u005chypertarget{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da220d8e8652d9b97fb66e476e2a60ffce}{}\u005clabel{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da220d8e8652d9b97fb66e476e2a60ffce}\n}]client packet payload goes out on wire unmunged only useful for security tests since normal servers cannot decode the content if used \u005cend{description}\n\u005cend{Desc}\n\n\u005cbegin{DoxyCode}\n2893 \u005c{\n2894 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da80e8f169fda236c56bfb795ed62903db}{LWS\u005c_WRITE\u005c_TEXT} \u003d 0,\n2898 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193daf6486c0dba50c44198100717721d9ab2}{LWS\u005c_WRITE\u005c_BINARY} \u003d 1,\n2901 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da10047eb05b5e1c298151dc47a5b44826}{LWS\u005c_WRITE\u005c_CONTINUATION} \u003d 2,\n2904 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dabb6705e1d1327cdda5025be28f07712e}{LWS\u005c_WRITE\u005c_HTTP} \u003d 3,\n2907 \u005ctextcolor{comment}{/* LWS\u005c_WRITE\u005c_CLOSE is handled by lws\u005c_close\u005c_reason() */}\n2908 LWS\u005c_WRITE\u005c_PING \u003d 5,\n2909 LWS\u005c_WRITE\u005c_PONG \u003d 6,\n2910 \n2911 \u005ctextcolor{comment}{/* Same as write\u005c_http but we know this write ends the transaction */}\n2912 LWS\u005c_WRITE\u005c_HTTP\u005c_FINAL \u003d 7,\n2913 \n2914 \u005ctextcolor{comment}{/* HTTP2 */}\n2915 \n2916 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193dafe5a38e940ce56708ac814627e9c0917}{LWS\u005c_WRITE\u005c_HTTP\u005c_HEADERS} \u003d 8,\n2923 \u005ctextcolor{comment}{/****** add new things just above ---^ ******/}\n2924 \n2925 \u005ctextcolor{comment}{/* flags */}\n2926 \n2927 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da115440f272a5d55518adfc8099acfee3}{LWS\u005c_WRITE\u005c_NO\u005c_FIN} \u003d 0x40,\n2930 \u005chyperlink{group__sending-data_gga98b099cf8c1c7e38ad78501f270e193da220d8e8652d9b97fb66e476e2a60ffce}{LWS\u005c_WRITE\u005c_CLIENT\u005c_IGNORE\u005c_XOR\u005c_MASK} \u003d 0x80\n2934 \u005c};\n\u005cend{DoxyCode}\n\n\n\u005csubsection{Function Documentation}\n\u005cindex{Sending data@{Sending data}!lws\u005c+\u005c_\u005c+write@{lws\u005c+\u005c_\u005c+write}}\n\u005cindex{lws\u005c+\u005c_\u005c+write@{lws\u005c+\u005c_\u005c+write}!Sending data@{Sending data}}\n\u005csubsubsection[{\u005ctexorpdfstring{lws\u005c+\u005c_\u005c+write(struct lws $\u005cast$wsi, unsigned char $\u005cast$buf, size\u005c+\u005c_\u005c+t len, enum lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol protocol)}{lws\u005c_write(struct lws *wsi, unsigned char *buf, size\u005c_t len, enum lws\u005c_write\u005c_protocol protocol)}}]{\u005csetlength{\u005crightskip}{0pt plus 5cm}L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+V\u005c+I\u005c+S\u005c+I\u005c+B\u005c+LE L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+E\u005c+X\u005c+T\u005c+E\u005c+RN int lws\u005c+\u005c_\u005c+write (\n\u005cbegin{DoxyParamCaption}\n\u005citem[{struct lws $\u005cast$}]{wsi, }\n\u005citem[{unsigned char $\u005cast$}]{buf, }\n\u005citem[{size\u005c+\u005c_\u005c+t}]{len, }\n\u005citem[{enum {\u005cbf lws\u005c+\u005c_\u005c+write\u005c+\u005c_\u005c+protocol}}]{protocol}\n\u005cend{DoxyParamCaption}\n)}\u005chypertarget{group__sending-data_gafd5fdd285a0e25ba7e3e1051deec1001}{}\u005clabel{group__sending-data_gafd5fdd285a0e25ba7e3e1051deec1001}\n\n\n{\u005cttfamily \u005c#include $\u003c$\u005chyperlink{libwebsockets_8h}{lib/libwebsockets.\u005c+h}$\u003e$}\n\n\u005chyperlink{group__sending-data_gafd5fdd285a0e25ba7e3e1051deec1001}{lws\u005c+\u005c_\u005c+write()} -\u005c/ Apply protocol then write data to client \n\u005cbegin{DoxyParams}{Parameters}\n{\u005cem wsi} \u0026 Websocket instance (available from user callback) \u005c\u005c\n\u005chline\n{\u005cem buf} \u0026 The data to send. For data being sent on a websocket connection (ie, not default http), this buffer M\u005c+U\u005c+ST have L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE bytes valid B\u005c+E\u005c+F\u005c+O\u005c+RE the pointer. This is so the protocol header data can be added in-\u005c/situ. \u005c\u005c\n\u005chline\n{\u005cem len} \u0026 Count of the data bytes in the payload starting from buf \u005c\u005c\n\u005chline\n{\u005cem protocol} \u0026 Use L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP to reply to an http connection, and one of L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY or L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT to send appropriate data on a websockets connection. Remember to allow the extra bytes before and after buf if L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY or L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT are used.\u005c\u005c\n\u005chline\n\u005cend{DoxyParams}\nThis function provides the way to issue data back to the client for both http and websocket protocols.\n\nI\u005c+M\u005c+P\u005c+O\u005c+R\u005c+T\u005c+A\u005c+NT N\u005c+O\u005c+T\u005c+I\u005c+C\u005c+E!\n\nWhen sending with websocket protocol\n\nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+XT, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+B\u005c+I\u005c+N\u005c+A\u005c+RY, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+C\u005c+O\u005c+N\u005c+T\u005c+I\u005c+N\u005c+U\u005c+A\u005c+T\u005c+I\u005c+ON, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+P\u005c+I\u005c+NG, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+P\u005c+O\u005c+NG\n\nthe send buffer has to have L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE bytes valid B\u005c+E\u005c+F\u005c+O\u005c+RE the buffer pointer you pass to \u005chyperlink{group__sending-data_gafd5fdd285a0e25ba7e3e1051deec1001}{lws\u005c+\u005c_\u005c+write()}.\n\nThis allows us to add protocol info before and after the data, and send as one packet on the network without payload copying, for maximum efficiency.\n\nSo for example you need this kind of code to use lws\u005c+\u005c_\u005c+write with a 128-\u005c/byte payload\n\nchar buf\u005cmbox{[}L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE + 128\u005cmbox{]};\n\n// fill your part of the buffer... for example here it\u005ctextquotesingle{}s all zeros memset(\u005c\u0026buf\u005cmbox{[}\u005c+L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+R\u005c+E\u005cmbox{]}, 0, 128);\n\nlws\u005c+\u005c_\u005c+write(wsi, \u005c\u0026buf\u005cmbox{[}\u005c+L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+R\u005c+E\u005cmbox{]}, 128, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+T\u005c+E\u005c+X\u005c+T);\n\nWhen sending H\u005c+T\u005c+TP, with\n\nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+TP, L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+H\u005c+E\u005c+A\u005c+D\u005c+E\u005c+RS L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+W\u005c+R\u005c+I\u005c+T\u005c+E\u005c+\u005c_\u005c+\u005c+H\u005c+T\u005c+T\u005c+P\u005c+\u005c_\u005c+\u005c+F\u005c+I\u005c+N\u005c+AL\n\nthere is no protocol data prepended, and don\u005ctextquotesingle{}t need to take care about the L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE bytes valid before the buffer pointer.\n\nL\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE is at least the frame nonce + 2 header + 8 length L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+S\u005c+E\u005c+N\u005c+D\u005c+\u005c_\u005c+\u005c+B\u005c+U\u005c+F\u005c+F\u005c+E\u005c+R\u005c+\u005c_\u005c+\u005c+P\u005c+O\u005c+S\u005c+T\u005c+\u005c_\u005c+\u005c+P\u005c+A\u005c+D\u005c+D\u005c+I\u005c+NG is deprecated, it\u005ctextquotesingle{}s now 0 and can be left off. The example apps no longer use it.\n\nPad L\u005c+W\u005c+S\u005c+\u005c_\u005c+\u005c+P\u005c+RE to the C\u005c+PU word size, so that word references to the address immediately after the padding won\u005ctextquotesingle{}t cause an unaligned access error. Sometimes for performance reasons the recommended padding is even larger than sizeof(void $\u005cast$). \u005cbegin{DoxyVerb} In the case of sending using websocket protocol, be sure to allocate\n valid storage before and after buf as explained above. This scheme\n allows maximum efficiency of sending data and protocol in a single\n packet while not burdening the user code with any protocol knowledge.\n\n Return may be -1 for a fatal error needing connection close, or a\n positive number reflecting the amount of bytes actually sent. This\n can be less than the requested number of bytes due to OS memory\n pressure at any given time.\u005cend{DoxyVerb}\n ","s":{"c":1759435683,"u": 550}} ],"g": 5421,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}