interface class for application layer dealing with connection level events.
More...
#include <IConnectionListener.h>
interface class for application layer dealing with connection level events.
IConnectionListener defines an abstract interface that the user of AzNetworking is expected to implement to react and handle all IConnection related events, including the handling of any received IPacket derived packets. The AzNetworking user should derive a handler class from IConnectionListener, and provide an instance of that handler to any INetworkInterface the user instantiates. The lifetime of the IConnectionListener must outlive the lifetime of the INetworkInterface.
◆ OnConnect()
virtual void AzNetworking::IConnectionListener::OnConnect |
( |
IConnection * |
connection | ) |
|
|
pure virtual |
Invoked when a new connection is successfully established.
- Parameters
-
connection | pointer to the new connection instance |
◆ OnDisconnect()
virtual void AzNetworking::IConnectionListener::OnDisconnect |
( |
IConnection * |
connection, |
|
|
DisconnectReason |
reason, |
|
|
TerminationEndpoint |
endpoint |
|
) |
| |
|
pure virtual |
Called on disconnection from an connection.
- Parameters
-
connection | pointer to the connection instance generating the event |
reason | reason for the disconnect |
endpoint | whether the disconnection was initiated locally or remotely |
◆ OnPacketLost()
virtual void AzNetworking::IConnectionListener::OnPacketLost |
( |
IConnection * |
connection, |
|
|
PacketId |
packetId |
|
) |
| |
|
pure virtual |
Called when a packet is deemed lost by the remote connection.
- Parameters
-
connection | pointer to the connection instance generating the event |
packetId | identifier of the lost packet |
◆ OnPacketReceived()
Called on receipt of a packet from a connected connection.
- Parameters
-
connection | pointer to the connection instance generating the event |
packetHeader | packet header of the associated payload |
serializer | serializer instance containing the transmitted payload |
- Returns
- PacketDispatchResult result of the packet handling attempt
◆ ValidateConnect()
virtual ConnectResult AzNetworking::IConnectionListener::ValidateConnect |
( |
const IpAddress & |
remoteAddress, |
|
|
const IPacketHeader & |
packetHeader, |
|
|
ISerializer & |
serializer |
|
) |
| |
|
pure virtual |
Invoked to validate any new incoming connection from a new endpoint.
- Parameters
-
remoteAddress | the address of the remote endpoint initiating a connection |
packetHeader | packet header of the associated payload |
serializer | serializer instance containing the transmitted payload |
- Returns
- the result of the application layers validation of the connect message
The documentation for this class was generated from the following file:
- Code/Framework/AzNetworking/AzNetworking/ConnectionLayer/IConnectionListener.h