Giter Site home page Giter Site logo

Comments (3)

makarworld avatar makarworld commented on June 8, 2024

Can you send a sample code when you got this error, in what case?

from pymexc.

Speedy2k avatar Speedy2k commented on June 8, 2024

I also got this error with about any futures stream right now. Here is a exemple:

api_key = ""
api_secret = ""

def handle_message(message): 
    print(message)


futures_client = futures.HTTP(api_key = api_key, api_secret = api_secret)
ws_futures_client = futures.WebSocket(api_key = api_key, api_secret = api_secret)

print(futures_client.index_price("MX_USDT"))

ws_futures_client.deal_stream(handle_message, "MX_USDT")

while True:
    pass

I got this error!

Exception in thread Thread-2 (<lambda>):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/martin/.virtualenvs/mexc/lib/python3.10/site-packages/pymexc/base_websocket.py", line 151, in <lambda>
    self.wsl = threading.Thread(target=lambda: self._ping_loop(
  File "/home/martin/.virtualenvs/mexc/lib/python3.10/site-packages/pymexc/base_websocket.py", line 101, in _ping_loop
    self.ws.send(ping_payload)
  File "/home/martin/.virtualenvs/mexc/lib/python3.10/site-packages/websocket/_app.py", line 253, in send
    raise WebSocketConnectionClosedException(
websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.

from pymexc.

makarworld avatar makarworld commented on June 8, 2024

Fixed with commit 2e14ff8c...f044cc47

from pymexc.

Related Issues (7)

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.