Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reconnect loop #9

Closed
psykzz opened this issue Jan 14, 2022 · 2 comments
Closed

reconnect loop #9

psykzz opened this issue Jan 14, 2022 · 2 comments

Comments

@psykzz
Copy link
Contributor

psykzz commented Jan 14, 2022

Error connecting to server
Traceback (most recent call last):
  File "c:\Users\PsyKzz\Documents\Development\rustpy-discord\venv\lib\site-packages\rustplus\api\remote\rustws.py", line 115, in send_message
    self.send(raw_data, binary=True)
  File "c:\Users\PsyKzz\Documents\Development\rustpy-discord\venv\lib\site-packages\ws4py\websocket.py", line 303, in send
    self._write(m)
  File "c:\Users\PsyKzz\Documents\Development\rustpy-discord\venv\lib\site-packages\ws4py\websocket.py", line 285, in _write
    self.sock.sendall(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\PsyKzz\Documents\Development\rustpy-discord\venv\lib\site-packages\rustplus\api\remote\rustws.py", line 44, in connect
    super().connect()
  File "c:\Users\PsyKzz\Documents\Development\rustpy-discord\venv\lib\site-packages\ws4py\client\__init__.py", line 218, in connect
    self.sock.connect(self.bind_addr)
OSError: [WinError 10056] A connect request was made on an already connected socket
Cannot Connect to server. Retrying in 10

This happened because the server closed the connection

Error connecting to server
Traceback (most recent call last):
    b = self.sock.recv(self.reading_buffer_size)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

It looks like the reconnect logic needs to clear the existing socket first.

@olijeffers0n
Copy link
Owner

Yes, I am trying to re-work the whole WebSocket Connection but I have been busy with other things. I have also seemingly run out of ideas in order to fix it. If you have any ideas feel free to join the discord server to discuss it 😄

@olijeffers0n
Copy link
Owner

As of now an experimental build has been posted in the discord server which appears to fix issues like this. This will be released to master if functional. Thanks for raising this specific issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants