Skip to content

Commit

Permalink
make connect() timeout instead of block
Browse files Browse the repository at this point in the history
  • Loading branch information
jowrjowr authored and ettoreleandrotognoli committed May 6, 2019
1 parent 37ac11b commit 8bed899
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions asterisk/ami/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def next_action_id(self):

def connect(self):
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.settimeout(self._timeout)
self._socket.connect((self._address, self._port))
self.finished = threading.Event()
self._thread = threading.Thread(target=self.listen)
Expand Down

0 comments on commit 8bed899

Please sign in to comment.