bgp: catch socket error with sendall

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
FUJITA Tomonori 2014-06-15 21:22:36 +09:00
parent f513b8751d
commit ba9621627d

View File

@ -376,6 +376,8 @@ class BgpProtocol(Protocol, Activity):
self._sendlock.acquire()
try:
self._socket.sendall(msg.serialize())
except socket.error as err:
self.connection_lost('failed to write to socket')
finally:
self._sendlock.release()