Skip to content
Discussion options

You must be logged in to vote

However, I still want to have my message sending not tied to receiving messages from the websocket.

This shows one way to do that.

This is when I realize I don't understand how uWebsocket even handles threading. In the above example does every *ws have its own thread?

No. One thread can handle thousands of WebSocket connections.

Are all websockets on the same thread?

They are on as many threads as you create. The documentation says "If you want to, you can simply take the previous example, put it inside of a few std::thread and listen to separate ports, or share the same port (works on Linux)"

Replies: 1 comment 1 reply

Comment options

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

Answer selected by DeuSCaNoN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants