Interface ConnectionMonitor.Connection

All Superinterfaces:
com.fishlib.base.log.LogOutputAppendable
Enclosing class:
ConnectionMonitor

public static interface ConnectionMonitor.Connection extends com.fishlib.base.log.LogOutputAppendable
Behavior expected of a monitored connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the monitored connection.
    boolean
    Return true if the connection has been closed.
    void
    sendHeartbeat(long now)
    Cause the connection to send a heartbeat.

    Methods inherited from interface com.fishlib.base.log.LogOutputAppendable

    append
  • Method Details

    • sendHeartbeat

      void sendHeartbeat(long now) throws IOException
      Cause the connection to send a heartbeat. The monitor expects to receive a call to heartbeatResponse() with this connection's state as an argument within the configured ping interval. If it does not, we assume that connectivity is lost and shut down the process.
      Throws:
      IOException
    • close

      void close() throws IOException
      Close the monitored connection.
      Throws:
      IOException
    • isClosed

      boolean isClosed()
      Return true if the connection has been closed.