Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AddressFamily Property
Collapse the table of content
Expand the table of content

IPEndPoint.AddressFamily Property

Gets the Internet Protocol (IP) address family.

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

public override AddressFamily AddressFamily { get; }

Property Value

Type: System.Net.Sockets.AddressFamily
One of the AddressFamily values.

The AddressFamily indicates the address family for an instance of the IPEndPoint class.

The following example displays the AddressFamily property of the IPEndPoint specified.

IPAddress ipAddr2 = IPAddress.IPv6Loopback;
int port2 = 80;

IPEndPoint endpoint2 = new IPEndPoint(ipAddr2,port2);

outputBlock.Text += "IPEndPoint.Address: ";
outputBlock.Text += endpoint2.Address;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.AddressFamily: ";
outputBlock.Text += endpoint2.AddressFamily;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.Port: ";
outputBlock.Text += endpoint2.Port;
outputBlock.Text += "\n";

outputBlock.Text += "IPEndPoint.ToString(): ";
outputBlock.Text += endpoint2.ToString();
outputBlock.Text += "\n";


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2015 Microsoft