Lines Matching refs:timeout
30 - timeout should be intrinsic to the connection object instead of an
150 read_until(expected, [timeout])
151 Read until the expected string has been seen, or a timeout is
152 hit (default is no timeout); may block.
189 timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
194 and timeout are optional.
199 self.timeout = timeout
211 self.open(host, port, timeout)
213 def open(self, host, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
226 self.timeout = timeout
227 self.sock = socket.create_connection((host, port), timeout)
284 def read_until(self, match, timeout=None):
285 """Read until a given string is encountered or until timeout.
293 return self._read_until_with_poll(match, timeout)
295 return self._read_until_with_select(match, timeout)
297 def _read_until_with_poll(self, match, timeout):
298 """Read until a given string is encountered or until timeout.
300 This method uses select.poll() to implement the timeout.
303 call_timeout = timeout
304 if timeout is not None:
318 if timeout is not None:
320 call_timeout = timeout-elapsed
329 if timeout is not None:
331 if elapsed >= timeout:
333 call_timeout = timeout-elapsed
342 def _read_until_with_select(self, match, timeout=None):
343 """Read until a given string is encountered or until timeout.
345 The timeout is implemented using select.select().
357 if timeout is not None:
358 s_args = s_args + (timeout,)
371 if timeout is not None:
373 if elapsed >= timeout:
375 s_args = s_reply + (timeout-elapsed,)
627 def expect(self, list, timeout=None):
632 The optional second argument is a timeout, in seconds; default
633 is no timeout.
642 timeout happened).
650 return self._expect_with_poll(list, timeout)
652 return self._expect_with_select(list, timeout)
654 def _expect_with_poll(self, expect_list, timeout=None):
657 This method uses select.poll() to implement the timeout.
666 call_timeout = timeout
667 if timeout is not None:
688 if timeout is not None:
690 call_timeout = timeout-elapsed
704 if timeout is not None:
706 if elapsed >= timeout:
708 call_timeout = timeout-elapsed
717 def _expect_with_select(self, list, timeout=None):
720 The timeout is implemented using select.select().
729 if timeout is not None:
743 if timeout is not None:
745 if elapsed >= timeout:
747 s_args = ([self.fileno()], [], [], timeout-elapsed)
782 tn.open(host, port, timeout=0.5)