MCPcopy
hub / github.com/urllib3/urllib3 / start_connect

Method start_connect

src/urllib3/util/timeout.py:202–211  ·  view source on GitHub ↗

Start the timeout clock, used during a connect() attempt :raises urllib3.exceptions.TimeoutStateError: if you attempt to start a timer that has been started already.

(self)

Source from the content-addressed store, hash-verified

200 return Timeout(connect=self._connect, read=self._read, total=self.total)
201
202 def start_connect(self) -> float:
203 """Start the timeout clock, used during a connect() attempt
204
205 :raises urllib3.exceptions.TimeoutStateError: if you attempt
206 to start a timer that has been started already.
207 """
208 if self._start_connect is not None:
209 raise TimeoutStateError("Timeout timer has already been started.")
210 self._start_connect = time.monotonic()
211 return self._start_connect
212
213 def get_connect_duration(self) -> float:
214 """Gets the time elapsed since the call to :meth:`start_connect`.

Callers 3

test_timeout_elapsedMethod · 0.95
_make_time_passMethod · 0.80
_make_requestMethod · 0.80

Calls 1

TimeoutStateErrorClass · 0.85

Tested by 2

test_timeout_elapsedMethod · 0.76
_make_time_passMethod · 0.64