Package gda.io.socket
Class GdaSocketFactory
java.lang.Object
javax.net.SocketFactory
gda.io.socket.GdaSocketFactory
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSocket(String host, int port) Creates a socket and connects it to the specified remote host at the specified remote port.createSocket(String host, int port, InetAddress localHost, int localPort) Creates a socket and connects it to the specified remote host on the specified remote port.createSocket(InetAddress host, int port) Creates a socket and connects it to the specified port number at the specified address.createSocket(InetAddress host, int port, InetAddress localHost, int localPort) Creates a socket and connect it to the specified remote address on the specified remote port.Methods inherited from class javax.net.SocketFactory
createSocket, getDefault
-
Constructor Details
-
GdaSocketFactory
public GdaSocketFactory()
-
-
Method Details
-
createSocket
Creates a socket and connects it to the specified remote host at the specified remote port.- Specified by:
createSocketin classSocketFactory- 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:
createSocketin classSocketFactory- Parameters:
host- The hostname.port- The port number.localHost- The local hostname.localPort- The local port number.- Returns:
- Socket
- Throws:
UnknownHostException
-
createSocket
Creates a socket and connects it to the specified port number at the specified address.- Specified by:
createSocketin classSocketFactory- 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:
createSocketin classSocketFactory- Parameters:
host- The hostname.port- The port number.localHost- The local hostname.localPort- The local port number.- Returns:
- Socket
- Throws:
UnknownHostException
-