invisibleroads / invisibleroads/socketIO-client

Invalid empty packet received

Open
#220 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
441
Forks
204
PR merge metrics
No merged PRs in 30d

Description

I have flask-socket io server running with gevent and is able to connect from multiple machines but sometimes when i make client
connection with socket-io client it given error
[ERROR] ValueError: Invalid empty packet received
File "/var/task/handlers/ScanOnEvent.py", line 17, in handle_socket_client
sio.connect(f'{constants.SOCKET_BASE_URL}', headers={
File "/var/task/socketio/client.py", line 331, in connect
self.eio.connect(real_url, headers=real_headers,
File "/var/task/engineio/client.py", line 185, in connect
return getattr(self, 'connect' + self.transports[0])(
File "/var/task/engineio/client.py", line 324, in _connect_polling
if self._connect_websocket(url, headers, engineio_path):
File "/var/task/engineio/client.py", line 445, in _connect_websocket
pkt = packet.Packet(encoded_packet=p)
File "/var/task/engineio/packet.py", line 27, in __init__
self.decode(encoded_packet)
File "/var/task/engineio/packet.py", line 52, in decode
raise ValueError('Invalid empty packet received')

and
[ERROR] ConnectionError: One or more namespaces failed to connect
File "/var/task/handlers/ScanOnEvent.py", line 17, in handle_socket_client
sio.connect(f'{constants.SOCKET_BASE_URL}', headers={
File "/var/task/socketio/client.py", line 347, in connect
raise exceptions.ConnectionError(

this is the client side code
```
count = 0
for i in range(10):
sio = socketio.Client()
try:
sio.connect('URL_HERE', headers={})
count += 1
except Exception as e:
print(e)
```

This error comes randomly ie out to 10 sometimes 3, sometimes 4

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.