handle socket error

This commit is contained in:
ThomasV 2012-03-15 15:18:07 +03:00
parent c6c8c5c077
commit e9f89826d7
1 changed files with 5 additions and 2 deletions

View File

@ -693,12 +693,15 @@ def tcp_client_thread(ipaddr,conn):
msg = ''
while not stopping:
d = conn.recv(1024)
msg += d
try:
d = conn.recv(1024)
except socket.error:
d = ''
if not d:
close_session(session_id)
break
msg += d
while True:
s = msg.find('\n')
if s ==-1: