Browse Source

Sets the server's socket timeout to 30.0 seconds.

As the server is single threaded, it's better to have a short socket timeout
configured, such that waiting for data from the client may terminate early in
case of a connection problem. The server then can continue waiting for other
peers.
Stefan Laudemann 9 years ago
parent
commit
efcba2c2ed
1 changed files with 1 additions and 0 deletions
  1. 1 0
      server.py

+ 1 - 0
server.py

@@ -14,6 +14,7 @@ def server(port, bindTo):
 	BUFFER_SIZE = 1024
  
 	s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
+	s.settimeout(30.0)
 	s.bind((bindTo, port))
 	s.listen(1)
 	print('DebugReport server listening on [{0}]:{1}'.format(bindTo, port))