fix socket timeouts in irc

This commit is contained in:
Ryan Hitchman 2009-11-21 15:55:52 -07:00
parent 5dd972a00e
commit 238f1e0951
1 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,10 @@ class crlf_tcp(object):
def recv_loop(self):
while True:
self.ibuffer += self.socket.recv(4096)
try:
self.ibuffer += self.socket.recv(4096)
except socket.timeout:
continue
while '\r\n' in self.ibuffer:
line, self.ibuffer = self.ibuffer.split('\r\n', 1)
self.iqueue.put(decode(line))