Package it.polimi.ingsw.client
Class NetworkHandler
java.lang.Object
it.polimi.ingsw.client.NetworkHandler
- All Implemented Interfaces:
java.lang.Runnable
public class NetworkHandler
extends java.lang.Object
implements java.lang.Runnable
Handles connection to the server.
Receives and sends game messages.
-
Constructor Summary
Constructors Constructor Description NetworkHandler(java.net.Socket server, Client client) -
Method Summary
Modifier and Type Method Description voidhandleClientResponse(java.lang.Object clientResponse)Handles the answer of the client to send to the server.booleanisConnected()voidrun()
-
Constructor Details
-
Method Details
-
run
public void run()- Specified by:
runin interfacejava.lang.Runnable
-
handleClientResponse
public void handleClientResponse(java.lang.Object clientResponse) throws java.io.IOExceptionHandles the answer of the client to send to the server.- Parameters:
clientResponse- What the client wants to send to teh server.- Throws:
java.io.IOException- If the write object gives some problems.
-
isConnected
public boolean isConnected()
-