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)

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.

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");
      }
   }
}
System_CAPS_importantImportant

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

Return to top
Show: