我有以下代码:
client = await AsyncClient.create(api_key=api_key, api_secret=api_secret)
bm = BinanceSocketManager(client, user_timeout=60)
tst = bm.multiplex_socket(['btcusdt@ticker'])
async with tst as tscmt:
while True:
print('comes to this point')
res = await tscmt.recv()
print("waiting and waiting, don't come to this point anymore after x hours of working.")
__self__.doSomeStuff(res)
time.sleep(10)
基本上是从以下位置复制和粘贴:https://python-binance.readthedocs.io/en/latest/websockets.html
我不知道为什么,但是recv()
有时在5小时后挂起,有时在2天后挂起
我设置了一个user_timeout=60
,但这不起作用
有人有主意吗
目前没有回答
相关问题 更多 >
编程相关推荐