Package it.polimi.ingsw.server
Class ClientHandler
java.lang.Object
it.polimi.ingsw.server.ClientHandler
- All Implemented Interfaces:
java.lang.Runnable
public class ClientHandler
extends java.lang.Object
implements java.lang.Runnable
Handles all interactions between the server and a client.
-
Constructor Summary
Constructors Constructor Description ClientHandler(VirtualView client) -
Method Summary
Modifier and Type Method Description protected java.util.concurrent.SynchronousQueue<java.lang.Object>getObjectsQueue()protected voidkill()voidrun()While the connection is on, it allows to receive and read the Objects coming from the client-side.protected voidsendMessage(Message message)Sends message through network to client associated to this ClientHandler instance.
-
Constructor Details
-
Method Details
-
run
public void run()While the connection is on, it allows to receive and read the Objects coming from the client-side. Can understand if the message was a ping from the client or a different one.- Specified by:
runin interfacejava.lang.Runnable
-
sendMessage
Sends message through network to client associated to this ClientHandler instance.- Parameters:
message- message to send
-
kill
protected void kill() -
getObjectsQueue
protected java.util.concurrent.SynchronousQueue<java.lang.Object> getObjectsQueue()
-