LumiSoft Net Help
AddPortMapping Method (enabled, description, protocol, remoteHost, publicPort, localEP, leaseDuration)
Namespaces ► LumiSoft.Net.UPnP.NAT ► UPnP_NAT_Client ► AddPortMapping(Boolean, String, String, String, Int32, IPEndPoint, Int32)
This method creates a new port mapping or overwrites an existing mapping.
Declaration Syntax

C# | Visual Basic | Visual C++ | F#

    public void AddPortMapping(
    	bool enabled,
    	string description,
    	string protocol,
    	string remoteHost,
    	int publicPort,
    	IPEndPoint localEP,
    	int leaseDuration
    )

    Public Sub AddPortMapping (
    	enabled As Boolean,
    	description As String,
    	protocol As String,
    	remoteHost As String,
    	publicPort As Integer,
    	localEP As IPEndPoint,
    	leaseDuration As Integer
    )

    public:
    void AddPortMapping(
    	bool enabled,
    	String^ description,
    	String^ protocol,
    	String^ remoteHost,
    	int publicPort,
    	IPEndPoint^ localEP,
    	int leaseDuration
    )

    member AddPortMapping :
            enabled : bool *
            description : string *
            protocol : string *
            remoteHost : string *
            publicPort : int *
            localEP : IPEndPoint *
            leaseDuration : int -> unit

Parameters

enabled (Boolean)
  Specifies if port mapping is enabled.

description (String)
  Port mapping description.

protocol (String)
  Port mapping protocol. Nomrally this value TCP or UDP.

remoteHost (String)
  Remote host IP address.

publicPort (Int32)
  Desired public port.

localEP (IPEndPoint)
  Local IP end point.

leaseDuration (Int32)
  Lease duration in seconds. Value null means never expires.

Exceptions

Exception | Condition
--- | ---
ArgumentNullException | Is raised when description,protocol or localEP is null reference.
UPnP_Exception | Is raised when UPnP device returns error.

Assembly: LumiSoft.Net (Module: LumiSoft.Net.dll) Version: 4.5.5510.19119