Commit 0ac0941b authored by Michael Büsch's avatar Michael Büsch

coreserver: Handle socket EINTR

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 746821b5
......@@ -57,7 +57,8 @@ class TransferError(Exception):
if isinstance(parentException, socket.timeout) or\
isinstance(parentException, BlockingIOError) or\
_errno == errno.EAGAIN or\
_errno == errno.EWOULDBLOCK:
_errno == errno.EWOULDBLOCK or\
_errno == errno.EINTR:
reason = self.REASON_BLOCKING
else:
reason = self.REASON_UNKNOWN
......@@ -943,12 +944,10 @@ class AwlSimMessageTransceiver(object):
try:
data = self.sock.recv(hdrLen - len(self.buf))
except SocketErrors as e:
if e.errno == errno.EAGAIN or\
e.errno == errno.EWOULDBLOCK or\
isinstance(e, BlockingIOError):
transferError = TransferError(None, parentException = e)
if transferError.reason == TransferError.REASON_BLOCKING:
return None
raise TransferError(None,
parentException = e)
raise transferError
if not data:
# The remote end closed the connection
raise TransferError(None,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment