Set short timeout to fail fast when the OMM is unreachable

This commit is contained in:
clerie 2023-06-17 18:25:14 +02:00
parent 421cc06d6c
commit 11f96a6069
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class Connection:
self._host = host
self._port = port
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.settimeout(2)
self._seq = 0 # state of the sequence number generator
self._requests = {} # waiting area for pending responses