Class InboundConnectionActivity

java.lang.Object
org.mockserver.netty.connection.InboundConnectionActivity

public final class InboundConnectionActivity extends Object
What an inbound connection is doing, so InboundConnectionIdleHandler closes only connections that are genuinely quiet. Present on a channel only while an idle timeout is configured; every static helper is a no-op on a channel without it.

The exchange count is touched only on the connection's event loop (HttpExchangeTracker runs there, and so do write-completion listeners), so it needs no synchronisation.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isTracked(io.netty.channel.Channel channel)
    Whether an idle timeout is watching this connection, and so whether its HTTP exchanges need counting.
    static void
    markLongLived(io.netty.channel.Channel channel)
    Exempt a connection from the idle timeout for the rest of its life: it has become a WebSocket, a raw binary relay or the loopback leg of a tunnel, whose silences are legitimate and whose traffic is not HTTP exchanges.

    Methods inherited from class java.lang.Object

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

    • InboundConnectionActivity

      public InboundConnectionActivity()
  • Method Details

    • isTracked

      public static boolean isTracked(io.netty.channel.Channel channel)
      Whether an idle timeout is watching this connection, and so whether its HTTP exchanges need counting.
    • markLongLived

      public static void markLongLived(io.netty.channel.Channel channel)
      Exempt a connection from the idle timeout for the rest of its life: it has become a WebSocket, a raw binary relay or the loopback leg of a tunnel, whose silences are legitimate and whose traffic is not HTTP exchanges. The idle handler and exchange tracker are then removed, so its traffic no longer pays for them. The client's leg of a CONNECT/SOCKS tunnel is not exempt.