Package gda.io.socket

Class GdaSocketFactory

java.lang.Object
javax.net.SocketFactory
gda.io.socket.GdaSocketFactory

public class GdaSocketFactory extends SocketFactory

Title: The GDA socket factory.

Description: This class extends javax.net.SocketFactory to provide a socket factory for the GDA. Each socket opened is logged and any exceptions are caught and logged. This class provides a central location to set socket parameters. To ensure future flexibility the user of objects of this class should use a reference of type javax.net.SocketFactory.

  • Constructor Details

    • GdaSocketFactory

      public GdaSocketFactory()
  • Method Details

    • createSocket

      public Socket createSocket(String host, int port) throws UnknownHostException
      Creates a socket and connects it to the specified remote host at the specified remote port.
      Specified by:
      createSocket in class SocketFactory
      Parameters:
      host - The hostname.
      port - The port number.
      Returns:
      Socket
      Throws:
      UnknownHostException
    • createSocket

      public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws UnknownHostException
      Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied.
      Specified by:
      createSocket in class SocketFactory
      Parameters:
      host - The hostname.
      port - The port number.
      localHost - The local hostname.
      localPort - The local port number.
      Returns:
      Socket
      Throws:
      UnknownHostException
    • createSocket

      public Socket createSocket(InetAddress host, int port) throws UnknownHostException
      Creates a socket and connects it to the specified port number at the specified address.
      Specified by:
      createSocket in class SocketFactory
      Parameters:
      host - The hostname.
      port - The port number.
      Returns:
      Socket
      Throws:
      UnknownHostException
    • createSocket

      public Socket createSocket(InetAddress host, int port, InetAddress localHost, int localPort) throws UnknownHostException
      Creates a socket and connect it to the specified remote address on the specified remote port. The socket will also be bound to the local address and port suplied.
      Specified by:
      createSocket in class SocketFactory
      Parameters:
      host - The hostname.
      port - The port number.
      localHost - The local hostname.
      localPort - The local port number.
      Returns:
      Socket
      Throws:
      UnknownHostException