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
    void handleClientResponse​(java.lang.Object clientResponse)
    Handles the answer of the client to send to the server.
    boolean isConnected()  
    void run()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • handleClientResponse

      public void handleClientResponse​(java.lang.Object clientResponse) throws java.io.IOException
      Handles 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()