handle socket error
This commit is contained in:
parent
c6c8c5c077
commit
e9f89826d7
|
@ -693,12 +693,15 @@ def tcp_client_thread(ipaddr,conn):
|
||||||
msg = ''
|
msg = ''
|
||||||
|
|
||||||
while not stopping:
|
while not stopping:
|
||||||
d = conn.recv(1024)
|
try:
|
||||||
msg += d
|
d = conn.recv(1024)
|
||||||
|
except socket.error:
|
||||||
|
d = ''
|
||||||
if not d:
|
if not d:
|
||||||
close_session(session_id)
|
close_session(session_id)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
msg += d
|
||||||
while True:
|
while True:
|
||||||
s = msg.find('\n')
|
s = msg.find('\n')
|
||||||
if s ==-1:
|
if s ==-1:
|
||||||
|
|
Loading…
Reference in New Issue