Class SocketFactory


  • public class SocketFactory
    extends java.lang.Object
    This factory allows for creating regular sockets. If the tcp.source.port.range system property is set it will create sockets within the specified local port range (if the local port number is set to 0).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SocketFactory()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.Socket createSocket​(java.lang.String host, int port)  
      java.net.Socket createSocket​(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort)  
      java.net.Socket createSocket​(java.net.InetAddress address, int port)  
      java.net.Socket createSocket​(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort)  
      static SocketFactory getDefault()
      Returns the default instance of this class.
      • Methods inherited from class java.lang.Object

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

      • SocketFactory

        protected SocketFactory()
    • Method Detail

      • getDefault

        public static SocketFactory getDefault()
        Returns the default instance of this class.
        Returns:
        SocketFactory instance of this class.
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress address,
                                            int port)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port,
                                            java.net.InetAddress localAddr,
                                            int localPort)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress address,
                                            int port,
                                            java.net.InetAddress localAddr,
                                            int localPort)
                                     throws java.io.IOException
        Throws:
        java.io.IOException