public abstract class DaemonHttpServlet extends HttpServlet
RemoteDaemonHttpServlet
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Thread |
daemonThread |
protected int |
DEFAULT_PORT
The default listening port (1313)
|
Constructor and Description |
---|
DaemonHttpServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Halts the thread listening for socket connections.
|
protected int |
getSocketPort()
Returns the socket port on which the servlet will listen.
|
abstract void |
handleClient(Socket client)
Handles a new socket connection.
|
void |
init(ServletConfig config)
Begins a thread listening for socket connections.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
protected int DEFAULT_PORT
private Thread daemonThread
public DaemonHttpServlet()
public void init(ServletConfig config) throws ServletException
init
in interface Servlet
init
in class GenericServlet
config
- the servlet configServletException
- if a servlet exception occursprotected int getSocketPort()
public abstract void handleClient(Socket client)
client
- the client socketpublic void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses