Poloniex push api: 停止发送通道1002的数据

Poloniex push api: Stop sending data of channel 1002

我使用 python 从 wss://api2.poloniex.com:443 获取实时数据,它工作正常。
但有时服务器会停止发送通道1002的数据(勾选实时信息) 但仍有心跳[1010]
这是我的代码

from threading import Thread

import websocket

'''
Message format
[
    1002,                             Channel
    null,                             Unknown
    [
        121,                          CurrencyPairID
        "10777.56054438",             Last
        "10800.00000000",             lowestAsk
        "10789.20000001",             highestBid
        "-0.00860373",                percentChange
        "72542984.79776118",          baseVolume
        "6792.60163706",              quoteVolume
        0,                            isForzen
        "11400.00000000",             high24hr
        "9880.00000009"               low24hr
    ]
]
'''


class Ticker:



    def on_open(self, ws):
        ws.send(json.dumps({'command': 'subscribe', 'channel': 1002}))

    def on_message(self, ws, message):
        message = json.loads(message)
        print(message)

    def on_close(self, ws ):
        self.isReady = False
        logging.warning('Poloniex Ticker----------------------------CLOSE WebSocket-----------------------')
        logging.warning('Close Time : ' + timestampToDate(int(time.mktime(time.localtime())), True))
        time.sleep(1)
        logging.info('Restart Poloniex Ticker Socket')
        self.start()

    def start(self):
        logging.info('poloniex tick start')
        self.ws = websocket.WebSocketApp('wss://api2.poloniex.com:443', on_open=self.on_open, on_message=self.on_message,
                                         on_close=self.on_close, on_error=self.on_error)
        self.thread = Thread(target=self.ws.run_forever)
        self.thread.start() 

程序运行时是这样

当服务器停止发送通道1002的数据时

有什么想法吗?

Poloniex的websocket好像不稳定 会停止向Client发送数据 服务器繁忙时 2 分钟,即使您使用网络浏览器