Interface ResponsePacketHandler<P extends Packet,R extends Packet,C extends EngineConnection>
- Type Parameters:
P
- The type of the request packetR
- The type of the response packetC
- The connection type
- 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,C extends EngineConnection>
A specialized
PacketHandler
to handle response Packet
s.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
handleFailure
(ChannelException exception, P requestPacket, C connection) Handles the failure of a responsePacket
.void
handleResponse
(R responsePacket, P requestPacket, C connection) Handles the responsePacket
sent by a client connection.
-
Method Details
-
handleResponse
Handles the responsePacket
sent by a client connection.- Parameters:
responsePacket
- The response packet that was receivedrequestPacket
- The packet that was send to request the responseconnection
- The connection that sent the packet
-
handleFailure
Handles the failure of a responsePacket
. TheChannelException
which causes the failure will usually be aNoResponseException
, this is caused by the other side ignoring the request or failing to send a response.- Parameters:
exception
- The exception that caused the failurerequestPacket
- The packet that was send to request the responseconnection
- The remote connection that received the failure
-