Code Monkey home page Code Monkey logo

Comments (9)

skifli avatar skifli commented on August 17, 2024

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.

ThePrivatePanda avatar ThePrivatePanda commented on August 17, 2024

No, that has been handled.

from dankcord.

ThePrivatePanda avatar ThePrivatePanda commented on August 17, 2024

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.

skifli avatar skifli commented on August 17, 2024

Ok, so its a bit like the reconnect. Here's a pic from the docs.
image

from dankcord.

skifli avatar skifli commented on August 17, 2024

You just gotta handle it like a new session.

from dankcord.

ThePrivatePanda avatar ThePrivatePanda commented on August 17, 2024

That is handled as well. Currently, dankcord yeets the old connection and opens a new one.

from dankcord.

skifli avatar skifli commented on August 17, 2024

Well apparently it doesn't? Why is the error saying the connection is closed then?

from dankcord.

ThePrivatePanda avatar ThePrivatePanda commented on August 17, 2024

It should raise the exception before, in the receive part (_events_listener). The fact that it waits for heartbeat is more troublesome

from dankcord.

skifli avatar skifli commented on August 17, 2024

Hmm, then idk. I don't have that much knowledge of the code.

from dankcord.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.