Hello looks like i found solution !
use try: expect : in you on_data definition , looks like sometime in socket it is not able to decode stream and get close rather then printing error.
def on_data(wsapp, msg):
#print("Ticks: {}".format(msg))
try:
LIVE_FEED_JSON[msg['token']] = {'token' : msg['token'],'ltp' : msg['last_traded_price']/100 , 'timestamp' : datetime.fromtimestamp(msg['exchange_timestamp']/1000).isoformat()}
print(LIVE_FEED_JSON)
except Exception as e:
print(e)