BitMEX / api-connectors

Libraries for connecting to the BitMEX API.

Home Page:https://www.bitmex.com/app/restAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to close the connection properly?

stanislavhordiyenko opened this issue · comments

Hi, is there any way to close the connection to Bitmex API in Python? My unittests always contain the following warning after the run:

/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/suite.py:84: ResourceWarning: unclosed <ssl.SSLSocket fd=17, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.1.110', 51965), raddr=('104.18.15.180', 443)>
  return self.run(*args, **kwds)
commented

@stanhordiyenko I would also like to know how, any idea?

ws.exit() for the websocket