|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.jigsaw.http.Client | +--org.w3c.jigsaw.http.socket.SocketClient
This class implements the object that handles client connections. One such object exists per open connections at any given time.
The basic architecture is the following: the httpd instance accepts new connections on its port. When such a connection is accepted a Client object is requested to the client pool (which can implement what ever strategy is suitable). Each request is than managed by looking up an resource and invoking the resource methods corresponding to the request.
httpd
,
Request
,
Reply
Field Summary | |
protected boolean |
alive
Is this client still alive ? |
protected int |
bindcount
Number of times this client was bound to a connection. |
protected org.w3c.jigsaw.http.socket.SocketOutputBuffer |
bufout
Our reusable output buffer. |
protected boolean |
idle
Our we idle (waiting for next request ?) |
protected java.net.Socket |
socket
The socket currently handled by the client. |
protected java.lang.Thread |
thread
The thread that we have been attached to. |
Fields inherited from class org.w3c.jigsaw.http.Client |
buffer,
cont,
debug,
identifier,
prev_body_count,
reqcount,
server |
Method Summary | |
protected void |
bind(java.net.Socket socket)
SocketClientFactory interface - Bind the socket to this client. |
int |
getBindCount()
Get the total number of times this client was bound to a socket. |
java.net.InetAddress |
getInetAddress()
Client implementation - Get the IP address of this client. |
protected java.lang.Thread |
getThread()
Get the thread powering that client. |
protected boolean |
idleConnection()
Client implementation - The current connection is idle. |
void |
join()
If this client is allocated a thread, join it. |
protected void |
kill(boolean now)
SocketClientFactory interface - Kill this client. |
void |
run()
Run for our newly attached connection. |
protected void |
stopConnection()
Client implementation - This connection has been stopped. |
java.lang.String |
toString()
Print that client into a String. |
protected void |
unbind()
SocketClientFactory interface - Unbind this client. |
protected void |
usedConnection()
Client implementation - The current connection is in use. |
Methods inherited from class org.w3c.jigsaw.http.Client |
chunkTransfer,
emitReply,
error,
getIdentifier,
getInputStream,
getMajorVersion,
getMinorVersion,
getNextRequest,
getOutputStream,
getRequestCount,
getServer,
handleTimerEvent,
initialize,
interruptConnection,
isInterrupted,
isRunning,
log,
processRequest,
sendContinue,
startConnection,
trace,
tryKeepConnection |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.net.Socket socket
protected boolean alive
protected int bindcount
protected java.lang.Thread thread
protected org.w3c.jigsaw.http.socket.SocketOutputBuffer bufout
protected boolean idle
Method Detail |
public java.lang.String toString()
public void join()
public void run()
public java.net.InetAddress getInetAddress()
protected void stopConnection()
protected java.lang.Thread getThread()
protected boolean idleConnection()
protected void usedConnection()
protected void bind(java.net.Socket socket)
socket
- The socket this client should now handle.protected void unbind()
protected void kill(boolean now)
public final int getBindCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |