Every two minute i got this error - Connection error: 1006 - connection was closed uncleanly (None)

karthickbala123
karthickbala123 edited August 2020 in Python client
I read previous discussions about this error but am not resolve this issue
am also not using any computation inside on_ticks(). kindly help me
susbcription_list = [int(x) for x in trd_portfolio]
def getticks(ticks):
for tick in ticks:
ticks_token = tick['instrument_token']
push_tick_values_to_trd_portfolio(tick, ticks_token)

push_value_to_excel()
def on_ticks(ws, ticks):
# Todo: "On_ticks"
getticks(ticks)

def on_connect(ws, response):
ws.subscribe(susbcription_list)
ws.set_mode(ws.MODE_FULL, susbcription_list)


# Assign the callbacks.
kws.on_ticks = on_ticks
kws.on_connect = on_connect


kws.connect(threaded=True)

count = 0
while True:
count += 1
if count % 2 == 0:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL, susbcription_list)
else:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL, susbcription_list)

time.sleep(5)
Sign In or Register to comment.