Class DebugReceiveChannelEndpoint

All Implemented Interfaces:
AutoCloseable

public class DebugReceiveChannelEndpoint extends ReceiveChannelEndpoint
Debug implementation which can introduce loss.
  • Field Details

    • errorFramesSent

      protected final AtomicCounter errorFramesSent
      Counter for the number of errors frames send back by this channel endpoint.
  • Constructor Details

  • Method Details

    • sendTo

      public int sendTo(ByteBuffer buffer, InetSocketAddress remoteAddress)
      Send contents of ByteBuffer to the remote address.
      Overrides:
      sendTo in class ReceiveChannelEndpoint
      Parameters:
      buffer - to send containing the payload.
      remoteAddress - to send the payload to.
      Returns:
      number of bytes sent.
    • onDataPacket

      public int onDataPacket(DataHeaderFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
      Callback to handle a received data packet.
      Overrides:
      onDataPacket in class ReceiveChannelEndpoint
      Parameters:
      header - of the data first frame.
      buffer - containing the data packet.
      length - of the data packet.
      srcAddress - from which the data packet was received.
      transportIndex - on which the packet was received.
      Returns:
      number of bytes applied as a result of this action.
    • onSetupMessage

      public void onSetupMessage(SetupFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
      Callback to handle a received setup frame.
      Overrides:
      onSetupMessage in class ReceiveChannelEndpoint
      Parameters:
      header - of the setup frame.
      buffer - containing the setup frame.
      length - of the setup frame.
      srcAddress - the message came from.
      transportIndex - on which the message was received.
    • onRttMeasurement

      public void onRttMeasurement(RttMeasurementFlyweight header, UnsafeBuffer buffer, int length, InetSocketAddress srcAddress, int transportIndex)
      Callback to handle a received RTT Measurement frame.
      Overrides:
      onRttMeasurement in class ReceiveChannelEndpoint
      Parameters:
      header - of the RTT Measurement frame.
      buffer - containing the RTT Measurement frame.
      length - of the RTT Measurement frame.
      srcAddress - the message came from.
      transportIndex - on which the message was received.