Skip to content
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

Websocket connection was closed uncleanly #168

Open
abhishekg2389 opened this issue Sep 21, 2022 · 1 comment
Open

Websocket connection was closed uncleanly #168

abhishekg2389 opened this issue Sep 21, 2022 · 1 comment
Labels
reviewing reviewing the issue

Comments

@abhishekg2389
Copy link

abhishekg2389 commented Sep 21, 2022

Issue subject

Websocket connection was closed uncleanly

Expected behaviour

There should not be any WARNING when the connection is getting closed. Also, I am not sure if there is any side-effects of closing the connection uncleanly.

Actual behaviour

While closing the connection with my_client.stop() following warning comes : 2022-09-21 07:52:41.697 UTC WARNING binance.websocket.binance_client_protocol: WebSocket connection closed: connection was closed uncleanly ("peer dropped the TCP connection without previous WebSocket closing handshake"), code: 1006, clean: False, reason: connection was closed uncleanly ("peer dropped the TCP connection without previous WebSocket closing handshake")

Steps to reproduce

import os, certifi
os.environ['SSL_CERT_FILE'] = certifi.where()

import time
import logging
from binance.lib.utils import config_logging
from binance.websocket.spot.websocket_client import SpotWebsocketClient as Client

config_logging(logging, logging.DEBUG)


def message_handler(message):
    print(message)


my_client = Client()
my_client.start()

my_client.kline(symbol="btcusdt", id=1, interval="1m", callback=message_handler)
time.sleep(5)

my_client.stop() # line which produces warning

Environment

Relevant information about setup:

  • Version of binance-connector-python - 1.17.0
  • Python version - Python 3.10.6 (main, Sep 15 2022, 15:59:34) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
  • Operating system - MacOS Darwin
@2pd 2pd added the reviewing reviewing the issue label Sep 28, 2022
@2pd
Copy link
Contributor

2pd commented Feb 15, 2023

Please check the v3 websocket which has the new design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewing reviewing the issue
Projects
None yet
Development

No branches or pull requests

2 participants