From 36367e32a8c00cbbacb2cc7f7a09adde3e0cfaa9 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 11 十一月 2024 18:37:32 +0800
Subject: [PATCH] 扫过的单可继续扫/扫了未成交遵循顺位机制/唯一涨停原因的高位板要计算其身位

---
 utils/socket_util.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/socket_util.py b/utils/socket_util.py
index 57ad952..9b2e446 100644
--- a/utils/socket_util.py
+++ b/utils/socket_util.py
@@ -82,9 +82,11 @@
 
 
 # 绔彛鏄惁琚崰鐢�
-def is_port_bind(port):
+def is_port_bind(port, timeout=1):
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    sock.settimeout(timeout)
     result = sock.connect_ex(('127.0.0.1', port))
+    sock.close()
     if result == 0:
         return True
     else:
@@ -92,4 +94,4 @@
 
 
 if __name__ == "__main__":
-    pass
+    print(is_port_bind(9004))

--
Gitblit v1.8.0