-
Notifications
You must be signed in to change notification settings - Fork 134
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
websockets.exceptions.ConnectionClosedError: no close frame received or sent #196
Comments
You don't need to take any proactive measure to send a heartbeat packet with pybit. It does it for you. The code you mention is for javascript, not python. |
So...... why does this happen? |
I'm not able to reproduce this, can you send the code you used? |
Process WebSocketManager-4:1: The above exception was the direct cause of the following exception:
File "C:\Users\HSH\AppData\Roaming\Python\Python311\site-packages\pybithumb\websocket.py", line 71, in run
|
It looks like you're not using the If you disagree, please send the code you used so that I can try reproducing this problem. |
import time ######## Defines ########################### pybit = HTTP( ws = WebSocket( def handle_message(message):
############################################################
def sub_program(Set_Coin):
if name == "main":
This one is I used code. How can I solve this problem? |
Hi, I am a beginner.
I'm asking because an error occurred randomly when connecting to the web socket.
The error message is
"websockets.exceptions.ConnectionClosedError: no close frame received or sent"
Bybit's API document recommends sending Heartbeat Packet every 20 seconds to maintain a websocket connection.
Like this
ws.send(JSON.stringify({"req_id": "100001", "op": "ping"}));
It looks like this, but I don't think that part is working.
How do I do Heartbeat Packet to maintain a websocket connection in pybit?
The text was updated successfully, but these errors were encountered: