Unclean socket to be closed

hmatadhi
hmatadhi edited January 2 in Python client
Hi Team,

I am developing an app and while capturing ticks in on_ticks callback I closed the connection using ctrl-c.

Now I am getting continuously
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)

1. Is there any timeout on the server side so that this error is recovered
2. Is there any way I can issue a command to close the remote side connection

I already read about the ways to prevent this by making threading=true, I also am planning to catch ctrl-c signal handler and issue an explicit close. But before these safe preventive coding, I must know how to recover from the current situation.

Please help me,

Regards,
Harsha
  • hmatadhi
    hmatadhi edited January 2
    Update: I called with threaded=true, then the connect succeeded but on_ticks callback was never called. I reverted it and got the 1006 error again. Apparently threaded=true has not closed the remote connection at the remote side.
    I need to know how to clean this web socket connection.
    @sujith @rakeshr - Any help here?
  • rakeshr
    ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
    Can you paste here the complete error stack trace?
    1. Is there any timeout on the server side so that this error is recovered
    2. Is there any way I can issue a command to close the remote side connection
    Connection is closed, once you exit the code. I doesn't require any further command.
    The above error might be because of some other factor. Complete error stack trace, should shed more light.
  • hmatadhi
    Hey sorry, did not see this response. Actually I changed the access_token and subsequently apis started working. I am now not seeing this behaviour. I will post it when I get it back.
Sign In or Register to comment.