Closed martinsik closed 9 years ago
Specify the selectInterval
parameter on the init function of SimpleWebSocketServer (maybe 1 sec). If its not set then the blocking select will not be waiting on the descriptor unless the endpoint sends some data. Note that the above code is not thread safe with the current implementation.
Thanks, selectInterval
helped.
Can you give me just brief info why is this happening? Is it because the while True
loop blocks the main thread instead of SimpleWebSocketServer
so messages are queued but never actually sent?
What exactly is selectInterval doing? Why is this not thread safe?
Hi, I'm trying to run Web Socket server in another thread while being able to send messages to clients:
It doesn't seem to be sending any messages. Is it because the loop is blocking the main thread? Is there any better way to do it?