Show / Hide Table of Contents

# Class NatPunchModule

Module for UDP NAT Hole punching operations. Can be accessed from NetManager

##### Inheritance

object
NatPunchModule

###### Namespace: LiteNetLib

###### Assembly: LiteNetLib.dll

##### Syntax

    public sealed class NatPunchModule

### Fields

#### MaxTokenLength

##### Declaration

    public const int MaxTokenLength = 256

##### Field Value

Type | Description
--- | ---
int |

#### UnsyncedEvents

Events automatically will be called without PollEvents method from another thread

##### Declaration

    public bool UnsyncedEvents

##### Field Value

Type | Description
--- | ---
bool |

### Methods

#### Init(INatPunchListener)

##### Declaration

    public void Init(INatPunchListener listener)

##### Parameters

Type | Name | Description
--- | --- | ---
INatPunchListener | listener |

#### NatIntroduce(IPEndPoint, IPEndPoint, IPEndPoint, IPEndPoint, string)

##### Declaration

    public void NatIntroduce(IPEndPoint hostInternal, IPEndPoint hostExternal, IPEndPoint clientInternal, IPEndPoint clientExternal, string additionalInfo)

##### Parameters

Type | Name | Description
--- | --- | ---
IPEndPoint | hostInternal |
IPEndPoint | hostExternal |
IPEndPoint | clientInternal |
IPEndPoint | clientExternal |
string | additionalInfo |

#### PollEvents()

##### Declaration

    public void PollEvents()

#### SendNatIntroduceRequest(IPEndPoint, string)

##### Declaration

    public void SendNatIntroduceRequest(IPEndPoint masterServerEndPoint, string additionalInfo)

##### Parameters

Type | Name | Description
--- | --- | ---
IPEndPoint | masterServerEndPoint |
string | additionalInfo |

#### SendNatIntroduceRequest(string, int, string)

##### Declaration

    public void SendNatIntroduceRequest(string host, int port, string additionalInfo)

##### Parameters

Type | Name | Description
--- | --- | ---
string | host |
int | port |
string | additionalInfo |