|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.simpleSockets.ServeClient | +--com.objectwave.simpleSockets.ServeHTTPClient
Serve up data to one particular client. Two threads are used from a thread pool ro process requests. One thread reads data from the client, the other publishes data.
Field Summary |
Fields inherited from class com.objectwave.simpleSockets.ServeClient |
alive, debug, id, server, socket, thread |
Method Summary | |
void |
bind(java.net.Socket s)
Simply associate the socket that represents this client connection with this instance. |
protected java.lang.String |
extractRequest(java.lang.String str)
Skip some of the HTTP request header information. |
static com.objectwave.simpleSockets.ServeHTTPClient.HeaderAndData |
formatHTMLHeader(java.io.InputStream actualHtml)
Override this method to process your request. |
SimpleHTTP |
getGateway()
|
com.objectwave.simpleSockets.ServeHTTPClient.MyWriter |
getMyWriter()
The Writer represents the client. |
ReplyHandler |
getReplyHandler()
|
protected void |
loop()
This departs from the traditional simple server implementations. |
protected com.objectwave.simpleSockets.ServeHTTPClient.HeaderAndData |
processRequestData(java.lang.String requestString)
Override this method to process your request. |
static void |
setDefaultReplyHandler(ReplyHandler han)
Set the default ReplyHandler if none is specified for the particular instance. |
void |
setReplyHandler(ReplyHandler han)
Through use of a reply handler, the SimpleHTTP server can be used as is without requiring a subclass of special implementation. |
Methods inherited from class com.objectwave.simpleSockets.ServeClient |
emitReply, emitReplyStream, getName, handleSocketException, isBound, kill, loopForBinding, pause, processRequest, processRequestStream, run, runConnection, terminateConnection, unbind |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setDefaultReplyHandler(ReplyHandler han)
han
- ReplyHandler How to repsond to http requestspublic void setReplyHandler(ReplyHandler han)
han
- com.objectwave.simpleSockets.ReplyHandler A custom implementationpublic ReplyHandler getReplyHandler()
public com.objectwave.simpleSockets.ServeHTTPClient.MyWriter getMyWriter()
public void bind(java.net.Socket s) throws java.io.IOException
bind
in class ServeClient
s
- The socket this client should now handle.
java.io.IOException
public SimpleHTTP getGateway()
protected java.lang.String extractRequest(java.lang.String str)
str
- The string sent in over the socket
protected void loop() throws java.io.IOException, java.io.EOFException
loop
in class ServeClient
java.io.IOException
java.io.EOFException
protected com.objectwave.simpleSockets.ServeHTTPClient.HeaderAndData processRequestData(java.lang.String requestString) throws java.io.IOException
requestString
- The information on the HTTP request after the host and port
java.io.IOException
public static com.objectwave.simpleSockets.ServeHTTPClient.HeaderAndData formatHTMLHeader(java.io.InputStream actualHtml) throws java.io.IOException
actualHtml
- String Expected to be valid HTML.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |