|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object HttpServlet com.oreilly.servlet.DaemonHttpServlet
public abstract class DaemonHttpServlet
A superclass for HTTP servlets that wish to accept raw socket connections. DaemonHttpServlet starts listening for client requests in its init() method and stops listening in its destroy() method. In between, for every connection it receives, it calls the abstract handleClient(Socket client) method. This method should be implemented by the servlet subclassing DaemonHttpServlet. The port on which the servlet is to listen is determined by the getSocketPort() method.
RemoteDaemonHttpServlet
Constructor Summary | |
---|---|
DaemonHttpServlet()
|
Method Summary | |
---|---|
void |
destroy()
Halts the thread listening for socket connections. |
abstract void |
handleClient(java.net.Socket client)
Handles a new socket connection. |
void |
init(ServletConfig config)
Begins a thread listening for socket connections. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DaemonHttpServlet()
Method Detail |
---|
public void init(ServletConfig config) throws ServletException
config
- the servlet config
ServletException
- if a servlet exception occurspublic abstract void handleClient(java.net.Socket client)
client
- the client socketpublic void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |