Skip to content
Snippets Groups Projects
Commit 58f214ea authored by Andy Green's avatar Andy Green
Browse files

document revent clearing scheme

parent b1a5e6c3
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,13 @@ LWS_CALLBACK_SET_MODE_POLL_FD and LWS_CALLBACK_CLEAR_MODE_POLL_FD ...@@ -156,6 +156,13 @@ LWS_CALLBACK_SET_MODE_POLL_FD and LWS_CALLBACK_CLEAR_MODE_POLL_FD
appear in the callback for protocol 0 and allow interface code to appear in the callback for protocol 0 and allow interface code to
manage socket descriptors in other poll loops. manage socket descriptors in other poll loops.
You can pass all pollfds that need service to libwebsocket_service_fd(), even
if the socket or file does not belong to libwebsockets it is safe.
If libwebsocket handled it, it zeros the pollfd revents field before returning.
So you can let libwebsockets try and if pollfd->revents is nonzero on return,
you know it needs handling by your code.
Using with in c++ apps Using with in c++ apps
---------------------- ----------------------
......
...@@ -14,6 +14,12 @@ User api additions ...@@ -14,6 +14,12 @@ User api additions
added, replacing CIPHERS_LIST_STRING. NULL means use the ssl library added, replacing CIPHERS_LIST_STRING. NULL means use the ssl library
default list of ciphers. default list of ciphers.
- Not really an api addition, but libwebsocket_service_fd() will now zero
the revents field of the pollfd it was called with if it handled the
descriptor. So you can tell if it is a non-lws fd by checking revents
after the service call... if it's still nonzero, the descriptor
belongs to you and you need to take care of it.
User api changes User api changes
---------------- ----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment