public abstract class SocketSessionHandler extends SessionHandlerBase implements java.lang.Runnable
Implementation of a session handler that uses a Java socket to listen for incoming session requests.
ListenBacklog
Constructor and Description |
---|
SocketSessionHandler(java.lang.String name,
java.lang.String protocol,
NetworkServer server,
java.net.InetAddress addr,
int port)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
acceptConnection(java.net.Socket sock)
Accept a new connection on the specified socket
|
void |
closeSessionHandler(NetworkServer server)
Close the session handler
|
java.net.ServerSocket |
getSocket()
Return the server socket
|
int |
getSocketTimeout()
Return the client socket timeout, in milliseconds
|
void |
initializeSessionHandler(NetworkServer server)
Initialize the session handler
|
void |
run()
Socket listener thread
|
void |
setSocketTimeout(int tmo)
Set the client socket timeout, in milliseconds, zero for no timeout
|
clearShutdown, getBindAddress, getHandlerName, getListenBacklog, getNextSessionId, getPort, getProtocolName, getServer, hasBindAddress, hasDebug, hasShutdown, setDebug, setPort, setShutdown, toString
public SocketSessionHandler(java.lang.String name, java.lang.String protocol, NetworkServer server, java.net.InetAddress addr, int port)
name
- Stringprotocol
- Stringserver
- NetworkServeraddr
- InetAddressport
- intpublic final java.net.ServerSocket getSocket()
public final int getSocketTimeout()
public final void setSocketTimeout(int tmo)
tmo
- intpublic void initializeSessionHandler(NetworkServer server) throws java.io.IOException
initializeSessionHandler
in interface SessionHandlerInterface
initializeSessionHandler
in class SessionHandlerBase
server
- NetworkServerjava.io.IOException
public void closeSessionHandler(NetworkServer server)
closeSessionHandler
in interface SessionHandlerInterface
closeSessionHandler
in class SessionHandlerBase
server
- NetworkServerpublic void run()
run
in interface java.lang.Runnable
protected abstract void acceptConnection(java.net.Socket sock)
sock
- SocketCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.