I am not sure, if its because of weekend, I am getting below error when I try to connect ticker
WS connected Unhandled Error Traceback (most recent call last): File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\python\log.py", line 103, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\python\log.py", line 86, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\python\context.py", line 122, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\python\context.py", line 85, in callWithContext return func(*args,**kw) --- --- File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\internet\selectreactor.py", line 149, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\internet\tcp.py", line 205, in doRead return self._dataReceived(data) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\internet\tcp.py", line 211, in _dataReceived rval = self.protocol.dataReceived(data) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\protocols\tls.py", line 330, in dataReceived self._flushReceiveBIO() File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\protocols\tls.py", line 295, in _flushReceiveBIO ProtocolWrapper.dataReceived(self, bytes) File "C:\Users\praka\Anaconda3\lib\site-packages\twisted\protocols\policies.py", line 120, in dataReceived self.wrappedProtocol.dataReceived(data) File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\twisted\websocket.py", line 131, in dataReceived self._dataReceived(data) File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\websocket\protocol.py", line 1175, in _dataReceived self.consumeData() File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\websocket\protocol.py", line 1187, in consumeData while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED: File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\websocket\protocol.py", line 1553, in processData fr = self.onFrameEnd() File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\websocket\protocol.py", line 1674, in onFrameEnd self._onMessageEnd() File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\twisted\websocket.py", line 159, in _onMessageEnd self.onMessageEnd() File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\websocket\protocol.py", line 627, in onMessageEnd self._onMessage(payload, self.message_is_binary) File "C:\Users\praka\Anaconda3\lib\site-packages\autobahn\twisted\websocket.py", line 162, in _onMessage self.onMessage(payload, isBinary) File "C:\Users\praka\Anaconda3\lib\site-packages\kiteconnect\ticker.py", line 71, in onMessage self.factory.on_message(self, payload, is_binary) File "C:\Users\praka\Anaconda3\lib\site-packages\kiteconnect\ticker.py", line 643, in _on_message self.on_ticks(self, self._parse_binary(payload)) File "C:\Users\praka\Anaconda3\lib\site-packages\kiteconnect\ticker.py", line 730, in _parse_binary timestamp = datetime.fromtimestamp(self._unpack_int(packet, 28, 32)) builtins.OSError: [Errno 22] Invalid argument
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake) ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Can you remove
ws.stop()
from on_close method and check ?It still facing error, please paste here your WebSocket code.