Interface INatPunchListener
Interface for handling events related to NAT punchthrough and introduction.
Namespace: LiteNetLib
Assembly: LiteNetLib.dll
Syntax
public interface INatPunchListener
Methods
OnNatIntroductionRequest(IPEndPoint, IPEndPoint, string)
Called when a NAT introduction request is received from the mediator server.
Declaration
void OnNatIntroductionRequest(IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, string token)
Parameters
| Type | Name | Description |
|---|---|---|
| IPEndPoint | localEndPoint | The local endpoint of the client requesting connection. |
| IPEndPoint | remoteEndPoint | The remote endpoint of the client requesting connection. |
| string | token | Custom data token associated with the request. |
OnNatIntroductionSuccess(IPEndPoint, NatAddressType, string)
Called when NAT punchthrough is successful and a direct connection can be established.
Declaration
void OnNatIntroductionSuccess(IPEndPoint targetEndPoint, NatAddressType type, string token)
Parameters
| Type | Name | Description |
|---|---|---|
| IPEndPoint | targetEndPoint | The resolved endpoint of the remote peer. |
| NatAddressType | type | The type of address (Internal or External) that succeeded. |
| string | token | Custom data token associated with the request. |