| java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.oreilly.servlet.DaemonHttpServlet
All known Subclasses: com.oreilly.servlet.RemoteDaemonHttpServlet,
DaemonHttpServlet | abstract public class DaemonHttpServlet extends HttpServlet (Code) | | 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.
See Also: com.oreilly.servlet.RemoteDaemonHttpServlet author: Jason Hunter, Copyright © 1998 version: 1.0, 98/09/18 |
Method Summary | |
public void | destroy() Halts the thread listening for socket connections. | protected int | getSocketPort() Returns the socket port on which the servlet will listen. | abstract public void | handleClient(Socket client) Handles a new socket connection. | public void | init(ServletConfig config) Begins a thread listening for socket connections. |
DEFAULT_PORT | protected int DEFAULT_PORT(Code) | | The default listening port (1313)
|
destroy | public void destroy()(Code) | | Halts the thread listening for socket connections. Subclasses
that override this method must be sure to first call
super.destroy().
|
getSocketPort | protected int getSocketPort()(Code) | | Returns the socket port on which the servlet will listen.
A servlet can change the port in three ways: by using the
socketPort init parameter, by setting the DEFAULT_PORT
variable before calling super.init(), or by overriding this
method's implementation.
the port number on which to listen |
handleClient | abstract public void handleClient(Socket client)(Code) | | Handles a new socket connection. Subclasses must define this method.
Parameters: client - the client socket |
init | public void init(ServletConfig config) throws ServletException(Code) | | Begins a thread listening for socket connections. Subclasses
that override this method must be sure to first call
super.init(config).
Parameters: config - the servlet config exception: ServletException - if a servlet exception occurs |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|