mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
fix errors
This commit is contained in:
parent
096d6fefe3
commit
50095bf4a7
|
|
@ -105,7 +105,12 @@ class TCPClient:
|
|||
@property
|
||||
def isConnected(self):
|
||||
"""!Property of client connected state"""
|
||||
_, write, _ = select.select([], [self._sock], [], 0.1)
|
||||
if write:
|
||||
try:
|
||||
if self._sock:
|
||||
read, write, _ = select.select([], [self._sock], [], 0.1)
|
||||
if read and write:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
logging.exception("cannot check connection status")
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ def test_serverStopsWhileConnected(getRunningServer, getClient):
|
|||
"""!Shutdown server while client is connected"""
|
||||
getClient.connect()
|
||||
getRunningServer.stop()
|
||||
timeout = 10
|
||||
timeout = 5
|
||||
while getClient.isConnected:
|
||||
time.sleep(0.1)
|
||||
timeout = timeout - 1
|
||||
|
|
@ -221,7 +221,7 @@ def test_serverHighLoad(getRunningServer):
|
|||
logging.debug("start sendThreads")
|
||||
threads = []
|
||||
for thr_id in range(10):
|
||||
thr = threading.Thread(target=sendThread, name="sendThread-"+str(thr_id))
|
||||
thr = threading.Thread(target=sendThread, name="sendThread-" + str(thr_id))
|
||||
thr.daemon = True
|
||||
thr.start()
|
||||
threads.append(thr)
|
||||
|
|
|
|||
Loading…
Reference in a new issue