forked from warmcat/libwebsockets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Andy Green
committed
Jan 29, 2013
1 parent
5e1b7ff
commit 6f520a5
Showing
12 changed files
with
59 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.