Skip to content

Commit

Permalink
setting blocking mode before sock.makefile to avoid socket timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
italorossi committed Jun 14, 2016
1 parent 44b06bb commit 8936f6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion greenswitch/esl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def connect(self):
self.sock.settimeout(self.timeout)
self.sock.connect((self.host, self.port))
self.connected = True
self.sock.settimeout(None)
self.sock_file = self.sock.makefile()
self._receive_events_greenlet = gevent.spawn(self.receive_events)
self._process_events_greenlet = gevent.spawn(self.process_events)
self._auth_request_event.wait()
self.authenticate()
self.sock.settimeout(None)

def receive_events(self):
buf = ''
Expand Down

0 comments on commit 8936f6c

Please sign in to comment.