Python websocket客户端';我们该怎么办?

Python websocket客户端';我们该怎么办?,python,websocket,Python,Websocket,我使用Python包进行一些客户机-服务器讨论 假设我执行以下操作: import websocket MAX_TIMEOUT = 1 * 60 # Maximum time to wait to establish the connection to the server. ws = websocket.create_connection("ws://128.52.195.211:8080/websocket") ws.settimeout(MAX_TIMEOUT) ws.send("Hel

我使用Python包进行一些客户机-服务器讨论

假设我执行以下操作:

import websocket
MAX_TIMEOUT = 1 * 60  # Maximum time to wait to establish the connection to the server.
ws = websocket.create_connection("ws://128.52.195.211:8080/websocket")
ws.settimeout(MAX_TIMEOUT)
ws.send("Hello, World!")
ws.send()
尝试向服务器发送消息的次数是多少?只有一个

如果您查看,它清楚地表明没有实现重试


ws.send
从有效负载创建帧(块),然后在
ws.send\u frame

中逐个发送每个帧。是的,仅1次,但您可以实现一个循环以在失败时重试,并设置最大重试次数。