code: static OutputStream connectToOneServer(String server, int port) throws IOException {
          try {
              Socket pushSocket = new Socket(server, port);
              OutputStream out = pushSocket.getOutputStream();
              m_logger.info("Connected to export endpoint node at: " + server + ":" + port);
              return out;
          } catch (UnknownHostException e) {
              m_logger.rateLimitedLog(120, Level.ERROR, e, "Don't know about host: " + server);
              throw e;
          } catch (IOException e) {
              m_logger.rateLimitedLog(120, Level.ERROR, e, "Couldn't get I/O for the connection to: " + server);
              throw e;
          }
      }
docs: Connect to a single server with retry. Limited exponential backoff.
  No timeout. This will run until the process is killed if it's not
  able to connect.
  
  @param server hostname:port or just hostname (hostname can be ip).
  @throws IOException