Skip to content

Commit

Permalink
Catch socket.error on recv in MasterClient
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Nov 15, 2009
1 parent 0a575c3 commit 47b2dc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pyscripts/MasterClient/masterctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def handle_close(self):
self.do_connect = True
self.close()
def handle_read(self):
self.read_buff += self.recv(4096)
try:
self.read_buff += self.recv(4096)
except socket.error:
logging.error('Could not read from socket')
return
tmp_buff = self.read_buff.split('\n')
self.read_buff = tmp_buff.pop()
for line in tmp_buff:
Expand Down

0 comments on commit 47b2dc3

Please sign in to comment.