RoleInstanceEndpoint.PublicIPEndpoint Property

 

Gets an IPEndPoint object for the role instance endpoint. The IPEndPoint object provides the port number for the direct port endpoint. The IP address in the property is unused.

Namespace:   Microsoft.WindowsAzure.ServiceRuntime
Assembly:  Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

Syntax

public abstract IPEndPoint PublicIPEndpoint { get; internal set; }
public:
property IPEndPoint^ PublicIPEndpoint {
    virtual IPEndPoint^ get() abstract;
    internal: virtual void set(IPEndPoint^ value) abstract;
}
abstract PublicIPEndpoint : IPEndPoint with get, internal set
Public MustOverride Property PublicIPEndpoint As IPEndPoint
    Get
    Friend Set
End Property

Property Value

Type: System.Net.IPEndPoint

Type: System.Net.IPEndPoint

An instance of IPEndPoint.

Remarks

The following code example shows how to retrieve the direct port IPEndPoint objects for the running role instances:

foreach (var role in RoleEnvironment.Roles)
{
   foreach (var roleInst in role.Value.Instances)
   {
      foreach (RoleInstanceEndpoint instanceEndpoint in roleInst.InstanceEndpoints.Values)
      {
         Trace.WriteLine("Instance endpoint port:" + instanceEndpoint.PublicIPEndpoint.Port, "Information");
      }
   }
}

Important

The value of this property is null when running in the emulator.

See Also

RoleEnvironment
RoleInstanceEndpoint Class
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top