code: private Socket connect( URI transportURI ) throws PacketTransportException
      {
          String protocol = transportURI.getScheme();
          String host = transportURI.getHost();
          int port = transportURI.getPort();
          int connectTimeout = settings.getIntProperty(FFMQClientSettings.TRANSPORT_TCP_CONNECT_TIMEOUT, 30);
          
          try
          {
              Socket socket = SocketUtils.setupSocket(createSocket(protocol),
  	                                                socketSendBufferSize,
  	                                                socketRecvBufferSize); 
              
              log.debug("#"+id+" opening a TCP connection to "+host+":"+port);
              socket.connect(new InetSocketAddress(host,port),connectTimeout*1000);
              
              return socket;
          }
          catch (ConnectException e)
          {
          	log.error("#"+id+" could not connect to "+host+":"+port+" (timeout="+connectTimeout+"s) : "+e.getMessage());
              throw new PacketTransportException("Could not connect to "+host+":"+port+" : "+e.toString());
          }
          catch (Exception e)
          {
              log.error("#"+id+" could not connect to "+host+":"+port+" (timeout="+connectTimeout+"s)",e);
              throw new PacketTransportException("Could not connect to "+host+":"+port+" : "+e.toString());
          }
      }
docs: Connect the transport to its remote endpoint