Stores serialized information from EndPoint derived classes.
Assemblies: System (in System.dll)
System.Net.Primitives (in System.Net.Primitives.dll)
Thetype exposes the following members.
|Equals||Determines whether the specified Object is equal to the current instance. (Overrides Object.Equals(Object).)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Overrides Object.GetHashCode.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns information about the socket address. (Overrides Object.ToString.)|
The first 2 bytes of the underlying buffer are reserved for the AddressFamily enumerated value. When the is used to store a serialized IPEndPoint, the third and fourth bytes are used to store port number information. The next bytes are used to store the IP address. You can access any information within this underlying byte buffer by referring to its index position; the byte buffer uses zero-based indexing. You can also use the Family and Size properties to get the AddressFamily value and the buffer size, respectively. To view any of this information as a string, use the ToString method.
'Creates an IpEndPoint. Dim ipAddress As IPAddress = Dns.Resolve("www.contoso.com").AddressList(0) Dim ipLocalEndPoint As New IPEndPoint(ipAddress, 11000) 'Serializes the IPEndPoint. Dim socketAddress As SocketAddress = ipLocalEndPoint.Serialize() 'Verifies that ipLocalEndPoint is now serialized by printing its contents. Console.WriteLine(("Contents of socketAddress are: " + socketAddress.ToString())) 'Checks the Family property. Console.WriteLine(("The address family of socketAddress is: " + socketAddress.Family.ToString())) 'Checks the underlying buffer size. Console.WriteLine(("The size of the underlying buffer is: " + socketAddress.Size.ToString())) End Sub 'MySerializeIPEndPointClassMethod
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)