host: catch BrokenPipeError while sending replies
Catch the BrokenPipeError exception when sending a reply. This will happen when the other side closes their side of the connection/pipe so in that case we just break out of the serve loop.
This commit is contained in:
parent
254c1cd9fb
commit
3a69bf39b7
1 changed files with 4 additions and 1 deletions
|
|
@ -257,7 +257,10 @@ class Service(abc.ABC):
|
|||
_, val, tb = sys.exc_info()
|
||||
reply = self.protocol.encode_exception(val, tb)
|
||||
|
||||
self.sock.send(reply, fds=fds)
|
||||
try:
|
||||
self.sock.send(reply, fds=fds)
|
||||
except BrokenPipeError:
|
||||
break
|
||||
|
||||
def _handle_message(self, msg, fds):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue