Closed ghost closed 2 years ago
Hey @ZeRo137 Does your traceback look like this? If so, I've got a similar issue.
----------------------------------------
Exception happened during processing of request from ('x.x.x.x', 65157)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 596, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 168, in __init__
StreamRequestHandler.__init__(self, socket, addr, server)
File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
self.handle()
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 181, in handle
self.read_next_message()
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 243, in read_next_message
opcode_handler(self, message_bytes.decode('utf8'))
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 127, in _message_received_
self.message_received(self.handler_to_client(handler), self, msg)
File "server.py", line 80, in message_received
server.send_message_to_all(message)
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 88, in send_message_to_all
self._multicast_(msg)
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 156, in _multicast_
self._unicast_(client, msg)
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 152, in _unicast_
to_client['handler'].send_message(msg)
File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 246, in send_message
self.send_text(message)
**File "/home/ubuntu/tools/python-websocket-server/websocket_server/websocket_server.py", line 296, in send_text
self.request.send(header + payload)
error: [Errno 32] Broken pipe**
----------------------------------------
This pull request seems to have fixed my issue.
I like your webscoket server its very helpful to me :] But i have a big problem sometimes when sending a message from the thread "a" the script freeze that happens after calling
self.request.send(header + payload)
Informations that can help: The server sends about 16packet/s for every client and there is on average 50 clients connected to the server on the same time, the script freeze once every 5minutes-2hours so i need to manualy restart the script everytime that happens and they need to reconnect. tested the script on both windows 10 and ubuntu 18,python 3.6 and python 3.7 and still the same problem.also added ssl