|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.clientserver.SimpleServer.ClientProcessor
This is the worker thread. Each client connecting will cause an instance of this to be spawned. Each client's thread terminates if the client logs or times out. Time out time is three seconds.
Field Summary | |
private ClientInfo |
ci
|
private boolean |
exit
|
private java.util.List |
hasToSend
|
private java.io.InputStream |
is
|
private java.io.OutputStream |
os
|
private java.net.Socket |
sock
|
Constructor Summary | |
SimpleServer.ClientProcessor(java.net.Socket sock,
ClientInfo ci)
Creates a instance with the given socket and the ClientInfo that identifies this client. |
Method Summary | |
void |
hasToSend(DataContainer dc)
Used to enqueue a DataContainer into this client's broadcast queue. |
void |
kill()
Stops a client's thread and removes the client from the server's clients list. |
private void |
processMessage(int msgType,
java.util.List res)
Processes an internal server message. |
void |
run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.InputStream is
private java.io.OutputStream os
private ClientInfo ci
private java.net.Socket sock
private boolean exit
private java.util.List hasToSend
Constructor Detail |
public SimpleServer.ClientProcessor(java.net.Socket sock, ClientInfo ci) throws java.lang.Exception
sock
- the socket to which is client is connectedci
- the ClientInfo
java.lang.Exception
- if anything goes wrong...Method Detail |
public void kill()
public void hasToSend(DataContainer dc)
dc
- the containerpublic void run()
run
in interface java.lang.Runnable
private void processMessage(int msgType, java.util.List res)
msgType
- intres
- List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |