Package za.co.wethinkcode.robots.client
Class ClientHandler
java.lang.Object
za.co.wethinkcode.robots.client.ClientHandler
- All Implemented Interfaces:
Runnable
-
Constructor Summary
ConstructorsConstructorDescriptionClientHandler(Socket socket, Memory memory) Create an Input and Output Stream from a socket. -
Method Summary
Modifier and TypeMethodDescriptionSimpler getter formemoryvoidrun()voidAppend the nextline of a scanner to the input buffervoidsingleCommandExecution(ClientNetworkInput networkIn, ClientNetworkOutput networkOut) Take in the input from theinputand send it over the network, then receive it's responsevoidstart()Start the execution loop of a handler.
-
Constructor Details
-
ClientHandler
Create an Input and Output Stream from a socket.- Parameters:
socket- the socket this Client is connecting to- Throws:
IOException- if there is a failure to connect to the socket being connected to
-
-
Method Details
-
setInput
Append the nextline of a scanner to the input buffer -
singleCommandExecution
public void singleCommandExecution(ClientNetworkInput networkIn, ClientNetworkOutput networkOut) throws EndExecutionException Take in the input from theinputand send it over the network, then receive it's response- Throws:
EndExecutionException
-
getMemory
Simpler getter formemory -
start
public void start()Start the execution loop of a handler.Wraps a call
run() -
run
public void run()
-