Skip to content
This SDK only works with devices released within the past 3 years. We regularly optimize and update the SDK to ensure compatibility and performance. We do not guarantee compatibility or provide technical support for devices older than 3 years.

# NET_SDK_SetNat2Addr

### Interface Definition

C++C#

    1
    2
    3
    BOOL NET_SDK_SetNat2Addr(
        char* sServerAddr,
        WORD wDVRPort);

    1
    2
    3
    public static extern bool NET_SDK_SetNat2Addr(
        string sServerAddr,
        ushort wDVRPort);

### Function Description

Set the P2P2.0 address.

### Parameter Description

Parameters | Type | Remark
--- | --- | ---
sServerAddrin | char* | IP address (in P2P mode, it is the P2P server address (c2020.autonat.com; if the user's P2P server is self-built, the corresponding server address must be filled in)).
wDVRPortin | WORD | P2P port number

### Return Value

- Type：BOOL

- Remark：Returns TRUE if successful, FALSE if failed.

### Remarks

If the P2P server has been called and set up, the original link will be disconnected if called again.

Error Code