Skip to content

Question about websocket read/writes thread safety. #1942

Discussion options

You must be logged in to vote

From the docs

NOTE: Since Mongoose's core is not protected against concurrent accesses, make sure that all mg_* API functions are called from the same thread or RTOS task.

If you absolutely need multi-threading, take the time to go through the user guide (linked above) and tutorials, there is one that shows you how to do multi-threading.

Please read the official docs instead of comments/issues from 2013, 10 years ago. Mongoose is 7.8 now

Your OS provides a socket environment and a select()/poll() call. Mongoose will wait on those sockets, so reads are not delayed.
Writes are immediately sent to the socket if UDP, and to a buffer if TCP. The poll timeout is the time mg_mgr_poll() provide…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kujukuju
Comment options

Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1941 on December 26, 2022 12:08.