Donate CPU: Make server more robust
This commit is contained in:
parent
7049249460
commit
5da38e33c0
|
@ -142,7 +142,10 @@ if __name__ == "__main__":
|
||||||
# wait for a connection
|
# wait for a connection
|
||||||
print('[' + strDateTime() + '] waiting for a connection')
|
print('[' + strDateTime() + '] waiting for a connection')
|
||||||
connection, client_address = sock.accept()
|
connection, client_address = sock.accept()
|
||||||
cmd = connection.recv(128)
|
try:
|
||||||
|
cmd = connection.recv(128)
|
||||||
|
except socket.error as e:
|
||||||
|
continue
|
||||||
if cmd.find('\n') < 1:
|
if cmd.find('\n') < 1:
|
||||||
continue
|
continue
|
||||||
firstLine = cmd[:cmd.find('\n')]
|
firstLine = cmd[:cmd.find('\n')]
|
||||||
|
|
Loading…
Reference in New Issue