canonical libwebsockets.org websocket library
![]() A common practise to temporarily disable a socket in a poll call is to negate the socket fd. poll should then ignore the socket. emulated_poll does this with the following code: if (poll_fd->fd < 0 || !poll_fd->events) goto skip1; However on Windows the fd field in WSAPOLLFD is unsigned int!!! So the check for a negative fd value always fails. This results in select returning an error with an error code of 10038 -- Socket operation on nonsocket. The fix is to type cast fd like so: if ((int)poll_fd->fd < 0 || !poll_fd->events) This may be the cause of some high CPU load reports. I noticed the load being 50% with my application running on Windows XP. Signed-off-by: Graham Newton <gnewton@peavey-eu.com> |
||
---|---|---|
cmake | ||
lib | ||
scripts | ||
test-server | ||
win32port | ||
.gitignore | ||
Android.mk | ||
changelog | ||
CMakeLists.txt | ||
config.h.cmake | ||
cross-arm-linux-gnueabihf.cmake | ||
libwebsockets-api-doc.html | ||
libwebsockets.spec | ||
LICENSE | ||
README | ||
README.build | ||
README.coding | ||
README.test-apps |
This is the libwebsockets C library for lightweight websocket clients and servers. For support, visit http://libwebsockets.org and consider joining the project mailing list at http://ml.libwebsockets.org/mailman/listinfo/libwebsockets You can get the latest version of the library from git http://git.libwebsockets.org https://github.com/warmcat/libwebsockets for more information: README.build - information on building the library README.coding - information for writing code using the library README.test-apps - information about the test apps built with the library