public abstract class SocketSessionHandler extends SessionHandlerBase implements Runnable
Implementation of a session handler that uses a Java socket to listen for incoming session requests.
ListenBacklog
Constructor and Description |
---|
SocketSessionHandler(String name,
String protocol,
NetworkServer server,
InetAddress addr,
int port)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
acceptConnection(Socket sock)
Accept a new connection on the specified socket
|
void |
closeSessionHandler(NetworkServer server)
Close the session handler
|
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(String name, String protocol, NetworkServer server, InetAddress addr, int port)
name
- Stringprotocol
- Stringserver
- NetworkServeraddr
- InetAddressport
- intpublic final ServerSocket getSocket()
public final int getSocketTimeout()
public final void setSocketTimeout(int tmo)
tmo
- intpublic void initializeSessionHandler(NetworkServer server) throws IOException
initializeSessionHandler
in interface SessionHandlerInterface
initializeSessionHandler
in class SessionHandlerBase
server
- NetworkServerIOException
public void closeSessionHandler(NetworkServer server)
closeSessionHandler
in interface SessionHandlerInterface
closeSessionHandler
in class SessionHandlerBase
server
- NetworkServerprotected abstract void acceptConnection(Socket sock)
sock
- SocketCopyright © 2005–2018 Alfresco Software. All rights reserved.