You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to z you, WebSocket++
WebSocket++ supports multi-threaded applications but you have to create the threads yourself.
WebSocket++ does not create the threads for you as explained by the
documentation:
In order to process user input while network processing occurs in the background we are going to use a separate thread for the WebSocket++
processing loop. This leaves the main thread free to process foreground user input.
Your test example sleeps, but your real program would probably replace sleep with code that does useful
work using CPU time. You probably want that work to be done in another thread if it takes a significant amount of time. You could make OnMessage
put the message in a queue and another thread could pop from that queue and spend as much time as it needs processing the message while the WebSocket++ thread still accepts connections and processes messages for other connections.