IPv6Any Field
Collapse the table of content
Expand the table of content

IPAddress.IPv6Any Field

 

The Socket.Bind method uses the IPv6Any field to indicate that a Socket must listen for client activity on all network interfaces.

Namespace:   System.Net
Assembly:  System (in System.dll)

Public Shared ReadOnly IPv6Any As IPAddress

Field Value

Type: System.Net.IPAddress

The IPv6Any field is equivalent to 0:0:0:0:0:0:0:0 in colon-hexadecimal notation, or to :: in compact notation.

The following code example displays the value of the current host's Any address in standard compressed format.

' This function prints the value of the current host's Any address in  
' standard compressed format. The Any address is used by the host to enable
' listening to client activities on all the interfaces for a given port.
Private Shared Sub printIPv6AnyAddress()
   Try
      ' Get the Any address.
      Dim any As IPAddress = IPAddress.IPv6Any

      ' Transform the Any address to a string using the overladed
      ' ToString() method. Note that the resulting string is in the compact 
      ' form: "::".
      Dim ipv6Any As String = any.ToString()

      ' Display the Any address.
      Console.WriteLine(("The IPv6 Any address is: " + ipv6Any))
   Catch e As Exception
      Console.WriteLine(("[printIPv6AnyAddress] Exception: " + e.ToString()))
   End Try
End Sub 'printIPv6AnyAddress

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show:
© 2016 Microsoft