Class STUNClient
Methods to resolve the public IP address and port information of the client.
Inheritance
System.Object
STUNClient
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.Net
Assembly: SIPSorcery.dll
Syntax
public class STUNClient
Fields
| Improve this Doc View SourceDEFAULT_STUN_PORT
Declaration
public const int DEFAULT_STUN_PORT = 3478
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetPublicIPAddress(String, Int32)
Used to get the public IP address of the client as seen by the STUN server.
Declaration
public static IPAddress GetPublicIPAddress(string stunServer, int port = 3478)
Parameters
Type | Name | Description |
---|---|---|
System.String | stunServer | A server to send STUN requests to. |
System.Int32 | port | The port to use for the request. Defaults to 3478. |
Returns
Type | Description |
---|---|
System.Net.IPAddress | The public IP address of the client. |
GetPublicIPEndPoint(String, Int32)
Used to get the public IP address and port as seen by the STUN server.
Declaration
public static IPEndPoint GetPublicIPEndPoint(string stunServer, int port = 3478)
Parameters
Type | Name | Description |
---|---|---|
System.String | stunServer | A server to send STUN requests to. |
System.Int32 | port | The port to use for the request. Defaults to 3478. |
Returns
Type | Description |
---|---|
System.Net.IPEndPoint | The public IP address and port of the client. |