catching timout in rocket sendall, thanks nickname

This commit is contained in:
mdipierro
2012-07-05 21:17:20 -05:00
parent b3139dbc49
commit ed30e169cd
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-05 10:51:00) dev
Version 2.00.0 (2012-07-05 21:17:15) dev
+9 -3
View File
@@ -17,7 +17,7 @@ SERVER_NAME = socket.gethostname()
SERVER_SOFTWARE = 'Rocket %s' % VERSION
HTTP_SERVER_SOFTWARE = '%s Python/%s' % (SERVER_SOFTWARE, sys.version.split(' ')[0])
BUF_SIZE = 16384
SOCKET_TIMEOUT = 1 # in secs
SOCKET_TIMEOUT = 10 # in secs
THREAD_STOP_CHECK_INTERVAL = 1 # in secs, How often should threads check for a server stop message?
IS_JYTHON = platform.system() == 'Java' # Handle special cases for Jython
IGNORE_ERRORS_ON_CLOSE = set([errno.ECONNABORTED, errno.ECONNRESET])
@@ -1342,10 +1342,16 @@ class Worker(Thread):
stat_msg)
try:
self.conn.sendall(b(msg))
except socket.timeout:
self.closeConnection = True
self.err_log.error(
'Tried to send "%s" to client but received timeout error'
% status)
except socket.error:
self.closeConnection = True
self.err_log.error('Tried to send "%s" to client but received socket'
' error' % status)
self.err_log.error(
'Tried to send "%s" to client but received socket error'
% status)
#def kill(self):
# if self.isAlive() and hasattr(self, 'conn'):