code: public void setTimeout(int timeout) {
      this.timeout = timeout;
      try {
        socket.setSoTimeout(timeout);
      } catch (SocketException sx) {
        LOGGER.warn("Could not set socket timeout.", sx);
      }
    }
docs: Sets the socket timeout
  
  @param timeout Milliseconds timeout