Class HeartbeatServer

java.lang.Object
it.polimi.ingsw.server.HeartbeatServer
All Implemented Interfaces:
java.lang.Runnable

public class HeartbeatServer
extends java.lang.Object
implements java.lang.Runnable
Sends ping -- here called pong as opposed to ping from client to server) -- to client in order to let a disconnected client know that he is no longer connected.
  • Constructor Summary

    Constructors 
    Constructor Description
    HeartbeatServer​(VirtualView client)  
  • Method Summary

    Modifier and Type Method Description
    void run()
    Schedules at fixed rate, while the client is still playing the game, the task to send the pong message to the client.
    void sendPong()
    Sends the pong message to the client.

    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()
      Schedules at fixed rate, while the client is still playing the game, the task to send the pong message to the client.
      Specified by:
      run in interface java.lang.Runnable
    • sendPong

      public void sendPong()
      Sends the pong message to the client.