keepalive.socket
Class SocketFactory
java.lang.Object
|
+--keepalive.socket.SocketFactory
- public class SocketFactory
- extends java.lang.Object
Create new AbstractSockets, whether real TCP/IP sockets or simulated sockets.
Method Summary |
static ServerSocketIfc |
createServerSocket()
Create a ServerSocket bound to the port SocketFactory.PORT |
static AbstractSocket |
createSocket(java.net.InetAddress addr)
Create a new client-side socket that connects to a serverhost. |
static java.lang.String |
getClientKeepAlive()
Get the Keep-Alive class used for all client-side sockets
produced by this factory. |
static java.lang.String |
getServerKeepAlive()
Get the Keep-Alive class used for all server-side sockets
produced by this factory. |
static void |
setClientKeepAlive(java.lang.String keepAliveClassName)
Set the Keep-Alive class to be used for all client-side sockets
produced by this factory. |
static void |
setServerKeepAlive(java.lang.String keepAliveClassName)
Set the Keep-Alive class to be used for all server-side sockets
produced by this factory. |
static void |
setSocketType(int sockType)
Set the type of sockets we will be producing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PORT
public static final int PORT
SOCKET
public static final int SOCKET
SIM_SOCKET
public static final int SIM_SOCKET
SocketFactory
public SocketFactory()
setSocketType
public static void setSocketType(int sockType)
- Set the type of sockets we will be producing
- Parameters:
a
- type of socket-- "real" or simulated-- using the
integer constants defined in this class.
createSocket
public static AbstractSocket createSocket(java.net.InetAddress addr)
throws java.io.IOException
- Create a new client-side socket that connects to a serverhost.
- Parameters:
addr
- the InetAddress of the server host.- Returns:
- a new socket
createServerSocket
public static ServerSocketIfc createServerSocket()
throws java.io.IOException
- Create a ServerSocket bound to the port SocketFactory.PORT
- Returns:
- a new ServerSocket.
setServerKeepAlive
public static void setServerKeepAlive(java.lang.String keepAliveClassName)
- Set the Keep-Alive class to be used for all server-side sockets
produced by this factory.
- Parameters:
keepAliveClassName
- the fully-specified name of
the Keep-Alive class to use.
setClientKeepAlive
public static void setClientKeepAlive(java.lang.String keepAliveClassName)
- Set the Keep-Alive class to be used for all client-side sockets
produced by this factory.
- Parameters:
keepAliveClassName
- the fully-specified name of
the Keep-Alive class to use.
getServerKeepAlive
public static java.lang.String getServerKeepAlive()
- Get the Keep-Alive class used for all server-side sockets
produced by this factory.
- Returns:
- the Keep-Alive class used for all server-side sockets
produced by this factory.
getClientKeepAlive
public static java.lang.String getClientKeepAlive()
- Get the Keep-Alive class used for all client-side sockets
produced by this factory.
- Returns:
- the Keep-Alive class used for all client-side sockets
produced by this factory.