mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() Libwebsockets is fundamentally singlethreaded... the existence of the fork and broadcast support, especially in the sample server is giving the wrong idea about how to use it. This replaces broadcast in the sample server with libwebsocket_callback_on_writable_all_protocol(). The whole idea of 'broadcast' is removed. All of the broadcast proxy stuff is removed: data must now be sent from the callback only. Doing othherwise is not reliable since the service loop may close the socket and free the wsi at any time, invalidating a wsi pointer held by another thread (don't do that!) Likewise the confirm_legit_wsi api added recently does not help the other thread case, since if the wsi has been freed dereferencing the wsi to study if it is legit or not will segfault in that case. So this is removed too. The overall effect is to push user code to only operate inside the protocol callbacks or external poll loops, ie, single thread context. Signed-off-by: Andy Green <andy.green@linaro.org> |
||
---|---|---|
.. | ||
.gitignore | ||
base64-decode.c | ||
client-handshake.c | ||
client-parser.c | ||
client.c | ||
daemonize.c | ||
extension-deflate-frame.c | ||
extension-deflate-frame.h | ||
extension-deflate-stream.c | ||
extension-deflate-stream.h | ||
extension.c | ||
getifaddrs.c | ||
getifaddrs.h | ||
handshake.c | ||
libwebsockets.c | ||
libwebsockets.h | ||
Makefile.am | ||
minilex.c | ||
output.c | ||
parsers.c | ||
private-libwebsockets.h | ||
server-handshake.c | ||
server.c | ||
sha-1.c |