Stores serialized information from EndPoint derived classes.
Assembly: System (in System.dll)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
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().)
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.
Legacy Code Example
//Creates an IpEndPoint. IPAddress ipAddress = Dns.Resolve("www.contoso.com").AddressList; IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000); //Serializes the IPEndPoint. SocketAddress socketAddress = ipLocalEndPoint.Serialize(); //Verifies that ipLocalEndPoint is now serialized by printing its contents. Console.WriteLine("Contents of the socketAddress are: " + socketAddress.ToString()); //Checks the Family property. Console.WriteLine("The address family of the socketAddress is: " + socketAddress.Family.ToString()); //Checks the underlying buffer size. Console.WriteLine("The size of the underlying buffer is: " + socketAddress.Size.ToString());
Available since 10
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.