Framework Professional Edition Package


com.prosyst.util.net
Interface SocketFactory

All Known Implementing Classes:
PlainSocketFactory

public interface SocketFactory

This is a facade for a socket factory service. The interface provides various methods for socket creation. Under this interface can be hidden protocol-specific implementation, while users are isolated from the protocol logic.

An implementation is provided by the TLS Client Bundle.


Method Summary
 java.net.Socket openProxySocket(java.net.InetAddress address, int port, java.net.InetAddress proxy, int pport)
          Connects a socket through a proxy to address and port.
 java.net.Socket openProxySocket(java.net.InetAddress address, int port, java.net.InetAddress proxy, int pport, java.util.Dictionary props)
          Connects a socket through a proxy to address and port.
 java.net.Socket openProxySocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, java.net.InetAddress proxy, int pport)
          Connects a socket through a proxy from localAddr and localPort ( multi IP machines)
 java.net.Socket openProxySocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, java.net.InetAddress proxy, int pport, java.util.Dictionary props)
          Connects a socket through a proxy from localAddr and localPort ( multi IP machines)
 java.net.Socket openProxySocket(java.lang.String host, int port, java.net.InetAddress proxy, int pport)
          Connects a socket using a proxy, specified by proxy and pport to the host, defined by host and port.
 java.net.Socket openProxySocket(java.lang.String host, int port, java.net.InetAddress proxy, int pport, java.util.Dictionary props)
           
 java.net.Socket openProxySocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort, java.net.InetAddress proxy, int pport)
          Connects a socket using a proxy from the local address (localAddr, localPort) to the remote address (host, port).
 java.net.Socket openProxySocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort, java.net.InetAddress proxy, int pport, java.util.Dictionary props)
           
 java.net.Socket openSocket(java.net.InetAddress address, int port)
          Opens a Socket and binds it to the remote address and port.
 java.net.Socket openSocket(java.net.InetAddress address, int port, java.util.Dictionary props)
          Opens a Socket and binds it to the remote address and port.
 java.net.Socket openSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort)
          Opens a Socket and binds it to the remote address and port from localAddr and localPort ( multi IP machines).
 java.net.Socket openSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, java.util.Dictionary props)
          Opens a Socket and binds it to address and port from localAddr and localPort ( multi IP machines).
 java.net.Socket openSocket(java.lang.String host, int port)
          Same as openSocket( InetAddress address, int port) but performs InetAddress.getByName(host) to obtain the address.
 java.net.Socket openSocket(java.lang.String host, int port, java.util.Dictionary props)
          Same as openSocket( InetAddress address, int port) but performs InetAddress.getByName(host) to obtain the address.
 java.net.Socket openSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort)
          Same as openSocket(InetAddress address, int port, InetAddress localAddr, int localPort) but performs InetAddress.getByName(host) to obtain the address.
 java.net.Socket openSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort, java.util.Dictionary props)
          Same as openSocket(InetAddress address, int port, InetAddress localAddr, int localPort) but performs InetAddress.getByName(host) to obtain the address.
 

Method Detail

openSocket

java.net.Socket openSocket(java.net.InetAddress address,
                           int port)
                           throws java.io.IOException
Opens a Socket and binds it to the remote address and port.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.net.InetAddress address,
                           int port,
                           java.util.Dictionary props)
                           throws java.io.IOException
Opens a Socket and binds it to the remote address and port.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.net.InetAddress address,
                           int port,
                           java.net.InetAddress localAddr,
                           int localPort)
                           throws java.io.IOException
Opens a Socket and binds it to the remote address and port from localAddr and localPort ( multi IP machines).

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.net.InetAddress address,
                           int port,
                           java.net.InetAddress localAddr,
                           int localPort,
                           java.util.Dictionary props)
                           throws java.io.IOException
Opens a Socket and binds it to address and port from localAddr and localPort ( multi IP machines).

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.lang.String host,
                           int port)
                           throws java.io.IOException
Same as openSocket( InetAddress address, int port) but performs InetAddress.getByName(host) to obtain the address.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.lang.String host,
                           int port,
                           java.util.Dictionary props)
                           throws java.io.IOException
Same as openSocket( InetAddress address, int port) but performs InetAddress.getByName(host) to obtain the address.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.lang.String host,
                           int port,
                           java.net.InetAddress localAddr,
                           int localPort)
                           throws java.io.IOException
Same as openSocket(InetAddress address, int port, InetAddress localAddr, int localPort) but performs InetAddress.getByName(host) to obtain the address.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openSocket

java.net.Socket openSocket(java.lang.String host,
                           int port,
                           java.net.InetAddress localAddr,
                           int localPort,
                           java.util.Dictionary props)
                           throws java.io.IOException
Same as openSocket(InetAddress address, int port, InetAddress localAddr, int localPort) but performs InetAddress.getByName(host) to obtain the address.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.net.InetAddress address,
                                int port,
                                java.net.InetAddress proxy,
                                int pport)
                                throws java.io.IOException
Connects a socket through a proxy to address and port.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
proxy - the address of the proxy
pport - the port of the proxy
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.net.InetAddress address,
                                int port,
                                java.net.InetAddress proxy,
                                int pport,
                                java.util.Dictionary props)
                                throws java.io.IOException
Connects a socket through a proxy to address and port.

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
proxy - the address of the proxy
pport - the port of the proxy
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.net.InetAddress address,
                                int port,
                                java.net.InetAddress localAddr,
                                int localPort,
                                java.net.InetAddress proxy,
                                int pport)
                                throws java.io.IOException
Connects a socket through a proxy from localAddr and localPort ( multi IP machines)

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
proxy - the address of the proxy
pport - the port of the proxy
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.net.InetAddress address,
                                int port,
                                java.net.InetAddress localAddr,
                                int localPort,
                                java.net.InetAddress proxy,
                                int pport,
                                java.util.Dictionary props)
                                throws java.io.IOException
Connects a socket through a proxy from localAddr and localPort ( multi IP machines)

Parameters:
address - remote address to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
proxy - the address of the proxy
pport - the port of the proxy
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.lang.String host,
                                int port,
                                java.net.InetAddress proxy,
                                int pport)
                                throws java.io.IOException
Connects a socket using a proxy, specified by proxy and pport to the host, defined by host and port.

Parameters:
host - remote host to bind the socket to
port - remote port to bind the socket to
proxy - the address of the proxy
pport - the port of the proxy
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.lang.String host,
                                int port,
                                java.net.InetAddress proxy,
                                int pport,
                                java.util.Dictionary props)
                                throws java.io.IOException
Parameters:
host - remote host to bind the socket to
port - remote port to bind the socket to
proxy - the address of the proxy
pport - the port of the proxy
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.
See Also:
openProxySocket(String host, int port, InetAddress proxy, int pport)

openProxySocket

java.net.Socket openProxySocket(java.lang.String host,
                                int port,
                                java.net.InetAddress localAddr,
                                int localPort,
                                java.net.InetAddress proxy,
                                int pport)
                                throws java.io.IOException
Connects a socket using a proxy from the local address (localAddr, localPort) to the remote address (host, port).

Parameters:
host - remote host to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
proxy - the address of the proxy
pport - the port of the proxy
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.

openProxySocket

java.net.Socket openProxySocket(java.lang.String host,
                                int port,
                                java.net.InetAddress localAddr,
                                int localPort,
                                java.net.InetAddress proxy,
                                int pport,
                                java.util.Dictionary props)
                                throws java.io.IOException
Parameters:
host - remote host to bind the socket to
port - remote port to bind the socket to
localAddr - local address to bind the socket from
localPort - local port to bind the socket from
proxy - the address of the proxy
pport - the port of the proxy
props - socket properties. Sockets can be customized via these properties. See SocketFactory implementation documentation for details on how to use these props.
Returns:
a Socket bound to the specified address and port
Throws:
java.io.IOException - If an I/O error occurs.
See Also:
openProxySocket(String host, int port, InetAddress localAddr, int localPort, InetAddress proxy, int pport)

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved