socket_pro 1.0.0__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {socket_pro-1.0.0 → socket_pro-1.1.0}/PKG-INFO +1 -1
- {socket_pro-1.0.0 → socket_pro-1.1.0}/pyproject.toml +1 -1
- {socket_pro-1.0.0 → socket_pro-1.1.0}/socket_pro/socket_client.py +4 -3
- {socket_pro-1.0.0 → socket_pro-1.1.0}/README.md +0 -0
- {socket_pro-1.0.0 → socket_pro-1.1.0}/socket_pro/__init__.py +0 -0
- {socket_pro-1.0.0 → socket_pro-1.1.0}/socket_pro/example/__init__.py +0 -0
- {socket_pro-1.0.0 → socket_pro-1.1.0}/socket_pro/example/client_example.py +0 -0
- {socket_pro-1.0.0 → socket_pro-1.1.0}/socket_pro/socket_server_asyncio.py +0 -0
|
@@ -80,10 +80,11 @@ class SocketClient:
|
|
|
80
80
|
response = self.socket.recv(self.buffer_size)
|
|
81
81
|
return True, response.decode("UTF-8")
|
|
82
82
|
return True, "发送成功, 不需要等待回复"
|
|
83
|
-
except
|
|
84
|
-
self.
|
|
83
|
+
except TimeoutError:
|
|
84
|
+
error_message = f"发送数据成功但是 socket 服务端未在 {self.time_out} 秒内回复"
|
|
85
|
+
self.logger.warning(error_message)
|
|
85
86
|
self.disconnect()
|
|
86
|
-
return False,
|
|
87
|
+
return False, error_message
|
|
87
88
|
|
|
88
89
|
def __enter__(self):
|
|
89
90
|
"""实现上下文管理协议,进入时自动连接."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|