Connect timeout in milliseconds. Default 120 secs.
765601
public int connectionTimeoutMs() {
    long defaultNetworkTimeoutS = JavaUtils.timeStringAsSec(
      conf.get("spark.network.timeout", "120s"));
    long defaultTimeoutMs = JavaUtils.timeStringAsSec(
      conf.get(SPARK_NETWORK_IO_CONNECTIONTIMEOUT_KEY, defaultNetworkTimeoutS + "s")) * 1000;
    return (int) defaultTimeoutMs;
  }
988862
def connection_made(self, transport):
        """"""
        self.logger.info('Connection made at object %s', id(self))
        self.transport = transport
        self.keepalive = True

        if self._timeout:
            self.logger.debug('Registering timeout event')
            self._timout_handle = self._loop.call_later(
                self._timeout, self._handle_timeout)
1273429
public void setTimeout(int timeout) {
    this.timeout = timeout;
    try {
      socket.setSoTimeout(timeout);
    } catch (SocketException sx) {
      LOGGER.warn("Could not set socket timeout.", sx);
    }
  }
702686
private void set_obj_timeout(final Connection connection, final int millis) {

		// Change Jacorb policy for timeout
		final org.omg.CORBA.Policy p =
			new org.jacorb.orb.policies.RelativeRoundtripTimeoutPolicy(10000 * millis);
		org.omg.CORBA.Object    obj = connection.getObj()._set_policy_override(
                new Policy[] { p }, org.omg.CORBA.SetOverrideType.ADD_OVERRIDE);

        //  Set new instances to connection object
        connection.setObj(obj);
        switch (connection.idl_version) {
            case 5:
                connection.device_5 = Device_5Helper.narrow(obj);
                break;
            case 4:
                connection.device_4 = Device_4Helper.narrow(obj);
                break;
            case 3:
                connection.device_3 = Device_3Helper.narrow(obj);
                break;
            case 2:
                connection.device_2 = Device_2Helper.narrow(obj);
                break;
            default:
                connection.device = DeviceHelper.narrow(obj);
                break;
        }

		// Save new timeout value
		connection.setDev_timeout(millis);
    }
912994
def time_out(self):
        
        _LOGGER.warning('Response timed out %s', self.session.host)
        self.stop()
        self.callback(SIGNAL_FAILED)
1238628
def timelimit(timeout):
    """"""
    def _1(function):
        def _2(*args, **kw):
            class Dispatch(threading.Thread):
                def __init__(self):
                    threading.Thread.__init__(self)
                    self.result = None
                    self.error = None

                    self.setDaemon(True)
                    self.start()

                def run(self):
                    try:
                        self.result = function(*args, **kw)
                    except:
                        self.error = sys.exc_info()

            c = Dispatch()
            c.join(timeout)
            if c.isAlive():
                raise TimeoutError, 'took too long'
            if c.error:
                raise c.error[0], c.error[1]
            return c.result
        return _2
    return _1
305693
def wait_for_connection(self, timeout=10):
        
        start_time = datetime.datetime.now()
        while True:
            if self.connected:
                return True
            now = datetime.datetime.now()
            if (now - start_time).total_seconds() > timeout:
                return False
            time.sleep(0.5)
268320
public void connect(SocketAddress endpoint, int timeout) throws IOException {
    String filename;
    if (host == null || host.equals("localhost")) {
      filename = "\\\\.\\pipe\\" + name;
    } else {
      filename = "\\\\" + host + "\\pipe\\" + name;
    }

    //use a default timeout of 100ms if no timeout set.
    int usedTimeout = timeout == 0 ? 100 : timeout;
    long initialNano = System.nanoTime();
    do {
      try {
        file = new RandomAccessFile(filename, "rw");
        break;
      } catch (FileNotFoundException fileNotFoundException) {
        try {
          //using JNA if available
          Kernel32.INSTANCE.WaitNamedPipe(filename, timeout);
          //then retry connection
          file = new RandomAccessFile(filename, "rw");
        } catch (Throwable cle) {
          // in case JNA not on classpath, then wait 10ms before next try.
          if (System.nanoTime() - initialNano > TimeUnit.MILLISECONDS.toNanos(usedTimeout)) {
            if (timeout == 0) {
              throw new FileNotFoundException(fileNotFoundException.getMessage()
                  + "\nplease consider set connectTimeout option, so connection can retry having access to named pipe. "
                  + "\n(Named pipe can throw ERROR_PIPE_BUSY error)");
            }
            throw fileNotFoundException;
          }
          try {
            TimeUnit.MILLISECONDS.sleep(5);
          } catch (InterruptedException interrupted) {
            IOException ioException = new IOException(
                "Interruption during connection to named pipe");
            ioException.initCause(interrupted);
            throw ioException;
          }
        }
      }
    } while (true);

    is = new InputStream() {
      @Override
      public int read(byte[] bytes, int off, int len) throws IOException {
        return file.read(bytes, off, len);
      }

      @Override
      public int read() throws IOException {
        return file.read();
      }

      @Override
      public int read(byte[] bytes) throws IOException {
        return file.read(bytes);
      }
    };

    os = new OutputStream() {
      @Override
      public void write(byte[] bytes, int off, int len) throws IOException {
        file.write(bytes, off, len);
      }

      @Override
      public void write(int value) throws IOException {
        file.write(value);
      }

      @Override
      public void write(byte[] bytes) throws IOException {
        file.write(bytes);
      }
    };
  }
979133
public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) {
		return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri,
				this.messageConverters, this.requestFactorySupplier,
				this.uriTemplateHandler, this.errorHandler, this.basicAuthentication,
				this.restTemplateCustomizers,
				this.requestFactoryCustomizer.connectTimeout(connectTimeout),
				this.interceptors);
	}
489536
private static int initializeTimeout() {
//        Integer tmp = java.security.AccessController.doPrivileged(
//          new GetIntegerAction("com.sun.security.crl.timeout"));
        Integer tmp = Integer.getInteger("com.sun.security.crl.timeout");
        if (tmp == null || tmp < 0) {
            return DEFAULT_CRL_CONNECT_TIMEOUT;
        }
        // Convert to milliseconds, as the system property will be
        // specified in seconds
        return tmp * 1000;
    }
993624
public void setConnectTimeout(long connectTimeout, TimeUnit unit) {
        this.connectTimeout = Duration.ofMillis(unit.toMillis(connectTimeout));
    }
474422
def _connect(self, sock, addr, timeout):
        """"""
        if self.connection:
            raise SocketClientConnectedError()

        if self.connector:
            raise SocketClientConnectingError()

        self.connect_deferred = Deferred(self.loop)
        self.sock = sock
        self.addr = addr
        self.connector = Connector(self.loop, sock, addr, timeout)
        self.connector.deferred.add_callback(self._connected)
        self.connector.deferred.add_errback(self._connect_failed)
        self.connector.start()

        return self.connect_deferred
495694
public boolean connect(long timeout) {
    if (this.wmi.connect(timeout)) {
      this.wmi.setStayConnected(true);
//      this.isReady = true;
      return true;
    }
    return false;
  }
587206
def connect(conn)
      start = Time.now
      conn.connect
      @latency = Time.now - start
      @down_at = nil
      true
    end
1003161
private static int initializeTimeout() {
//        Integer tmp = java.security.AccessController.doPrivileged(
//                new GetIntegerAction("com.sun.security.ocsp.timeout"));
        Integer tmp = Integer.getInteger("com.sun.security.ocsp.timeout");
        if (tmp == null || tmp < 0) {
            return DEFAULT_CONNECT_TIMEOUT;
        }
        // Convert to milliseconds, as the system property will be
        // specified in seconds
        return tmp * 1000;
    }
927368
public void setConnectTimeout(int timeout) {
		Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value");
		getHttpClient().getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout);
	}
1156549
def _startHungConnectionTimer(self):
        
        def hungConnection():
            self._hung_callback()
            self._hungConnectionTimer = None
            self.transport.loseConnection()
        self._hungConnectionTimer = self._reactor.callLater(
            self._HUNG_CONNECTION_TIMEOUT, hungConnection)