Comments (9)
Probably discord requesting reconnect (opcode 7)? Documented as happening randomly, whenever discord feels like it. For reconnecting, the session ID and last received sequence ID need to be sent when reconnecting
from dankcord.
No, that has been handled.
from dankcord.
Just occurred again and here's the traceback.
Exception in thread Thread-1 (heartbeat):
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "DankCord/src/DankCord/gateway.py", line 43, in heartbeat
self.ws.send(orjson.dumps({"op": 1, "d": None}))
File "DankCord/.env/lib/python3.11/site-packages/websocket/_core.py", line 283, in send
return self.send_frame(frame)
^^^^^^^^^^^^^^^^^^^^^^
File "DankCord/.env/lib/python3.11/site-packages/websocket/_core.py", line 311, in send_frame
l = self._send(data)
^^^^^^^^^^^^^^^^
File "DankCord/.env/lib/python3.11/site-packages/websocket/_core.py", line 525, in _send
return send(self.sock, data)
^^^^^^^^^^^^^^^^^^^^^
File "DankCord/.env/lib/python3.11/site-packages/websocket/_socket.py", line 143, in send
raise WebSocketConnectionClosedException("socket is already closed.")
websocket._exceptions.WebSocketConnectionClosedException: socket is already closed.
from dankcord.
Ok, so its a bit like the reconnect. Here's a pic from the docs.
from dankcord.
You just gotta handle it like a new session.
from dankcord.
That is handled as well. Currently, dankcord yeets the old connection and opens a new one.
from dankcord.
Well apparently it doesn't? Why is the error saying the connection is closed then?
from dankcord.
It should raise the exception before, in the receive part (_events_listener). The fact that it waits for heartbeat is more troublesome
from dankcord.
Hmm, then idk. I don't have that much knowledge of the code.
from dankcord.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dankcord.