Interface ResponsePacketHandler<P extends Packet,R extends Packet,S extends EngineConnectionState>

Type Parameters:
P - The type of the request packet
R - The type of the response packet
S - The connection state
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ResponsePacketHandler<P extends Packet,R extends Packet,S extends EngineConnectionState>
A specialized PacketHandler to handle response Packets.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    handleFailure(ChannelException exception, P requestPacket, S state)
    Handles the failure of a response Packet.
    void
    handleResponse(R responsePacket, P requestPacket, S state)
    Handles the response Packet sent by a client connection.
  • Method Details

    • handleResponse

      void handleResponse(R responsePacket, P requestPacket, S state)
      Handles the response Packet sent by a client connection.
      Parameters:
      responsePacket - The response packet that was received
      requestPacket - The packet that was send to request the response
      state - The state that sent the packet
    • handleFailure

      default void handleFailure(ChannelException exception, P requestPacket, S state)
      Handles the failure of a response Packet. The ChannelException which causes the failure will usually be a NoResponseException, this is caused by the other side ignoring the request or failing to send a response.
      Parameters:
      exception - The exception that caused the failure
      requestPacket - The packet that was send to request the response
      state - The remote state that received the failure