LumiSoft Net Help
GetPublicIP Method (stunServer, port, localIP)
Namespaces ► LumiSoft.Net.STUN.Client ► STUN_Client ► GetPublicIP(String, Int32, IPAddress)
Resolves local IP to public IP using STUN.
Declaration Syntax

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

    public static IPAddress GetPublicIP(
    	string stunServer,
    	int port,
    	IPAddress localIP
    )

    Public Shared Function GetPublicIP (
    	stunServer As String,
    	port As Integer,
    	localIP As IPAddress
    ) As IPAddress

    public:
    static IPAddress^ GetPublicIP(
    	String^ stunServer,
    	int port,
    	IPAddress^ localIP
    )

    static member GetPublicIP :
            stunServer : string *
            port : int *
            localIP : IPAddress -> IPAddress

Parameters

stunServer (String)
  STUN server.

port (Int32)
  STUN server port. Default port is 3478.

localIP (IPAddress)
  Local IP address.

Return Value
IPAddress
Returns public IP address.
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | Is raised when stunServer or localIP is null reference.
ArgumentException | Is raised when any of the arguments has invalid value.
IOException | Is raised when no connection to STUN server.

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