MCPcopy Create free account
hub / github.com/EasyIME/PIME / _handle_connect

Method _handle_connect

python/python3/tornado/iostream.py:1296–1322  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1294 return future
1295
1296 def _handle_connect(self) -> None:
1297 try:
1298 err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
1299 except socket.error as e:
1300 # Hurd doesn't allow SO_ERROR for loopback sockets because all
1301 # errors for such sockets are reported synchronously.
1302 if errno_from_exception(e) == errno.ENOPROTOOPT:
1303 err = 0
1304 if err != 0:
1305 self.error = socket.error(err, os.strerror(err))
1306 # IOLoop implementations may vary: some of them return
1307 # an error state before the socket becomes writable, so
1308 # in that case a connection failure would be handled by the
1309 # error path in _handle_events instead of here.
1310 if self._connect_future is None:
1311 gen_log.warning(
1312 "Connect error on fd %s: %s",
1313 self.socket.fileno(),
1314 errno.errorcode[err],
1315 )
1316 self.close()
1317 return
1318 if self._connect_future is not None:
1319 future = self._connect_future
1320 self._connect_future = None
1321 future_set_result_unless_cancelled(future, self)
1322 self._connecting = False
1323
1324 def set_nodelay(self, value: bool) -> None:
1325 if self.socket is not None and self.socket.family in (

Callers 1

_handle_connectMethod · 0.45

Calls 5

errno_from_exceptionFunction · 0.90
errorMethod · 0.80
filenoMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected