|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class is in charge of a client connection. It allow the user to handle request and to do answer to the distant machine the handler is bouded to.
ServerEvent.getHandler()
Method Summary | |
void |
doRequest(byte[] _data)
Send an request to the client. |
java.lang.String |
getClientHostAddress()
Returns the client's IP. |
java.lang.String |
getClientHostName()
Returns the client's hostname. |
boolean |
isRunning()
Indicates if the handler is running or not. |
void |
onRequest(byte[] _data)
Called when the handler receive a request from the client. |
void |
startHandler()
Starts the handler. |
void |
stopHandler()
Stops the handler. |
java.lang.String |
toString()
Returns a string representation of this ClientHandler. |
Methods inherited from interface java.lang.Runnable |
run |
Method Detail |
public void onRequest(byte[] _data) throws java.lang.IllegalStateException, InvalidRequestException
_data
- The data received from the client.
java.lang.IllegalStateException
- If the handler is not running.
InvalidRequestException
- If the request received from the client is not valid.Server.fireEvent(ServerEvent)
public void doRequest(byte[] _data) throws java.lang.IllegalStateException, InvalidRequestException
_data
- The answer to send to the client.
java.lang.IllegalStateException
- If the handler is not running.
InvalidRequestException
- If the request received from the client is not valid.public void stopHandler()
public void startHandler()
public boolean isRunning()
boolean
- True if the handler is running, false otherwise.public java.lang.String getClientHostAddress()
String
- The client's IP, as a string.public java.lang.String getClientHostName()
String
- The client's hostname.public java.lang.String toString()
toString
in class java.lang.Object
String
- A string representation of this client handler.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |