Class SocketConnector


  • public class SocketConnector
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SocketConnector()
      Creates a new instance that creates a plain socket by default.
    • Method Summary

      Modifier and Type Method Description
      java.net.Socket createSocket​(java.lang.String destination, int port)
      Create a new client Socket to the given destination and port.
      void setSSLType​(java.lang.String type)
      Set the type of SSL connection to use.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SocketConnector

        public SocketConnector()
        Creates a new instance that creates a plain socket by default.
    • Method Detail

      • setSSLType

        public void setSSLType​(java.lang.String type)
        Set the type of SSL connection to use. Specify null or an empty string to use a plain socket.
        Parameters:
        type - The SSL connection type
      • createSocket

        public java.net.Socket createSocket​(java.lang.String destination,
                                            int port)
        Create a new client Socket to the given destination and port. If an SSL socket type has not been specified (by setSSLType(String)), then a plain socket will be created. Otherwise, a new SSL socket of the specified type will be created.
        Parameters:
        destination - destination host
        port - a port to connect to
        Returns:
        a new client socket, or null if