Export (0) Print
Expand All

SocketAddress Class

Stores serialized information from EndPoint derived classes.

System.Object
  System.Net.SocketAddress

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

[DefaultMemberAttribute("Item")]
public class SocketAddress

The SocketAddress type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSocketAddress(AddressFamily)Creates a new instance of the SocketAddress class for the given address family.
Public methodSupported by Silverlight for Windows PhoneSocketAddress(AddressFamily, Int32)Creates a new instance of the SocketAddress class using the specified address family and buffer size.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneFamilyGets the AddressFamily enumerated value of the current SocketAddress.
Public propertySupported by Silverlight for Windows PhoneItemGets or sets the specified index element in the underlying buffer.
Public propertySupported by Silverlight for Windows PhoneSizeGets the available buffer size that can be used for the SocketAddress.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEqualsDetermines whether the specified Object is equal to the current SocketAddress instance. (Overrides Object.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeReturns a hash value for the SocketAddress. (Overrides Object.GetHashCode().)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents information about the socket address. (Overrides Object.ToString().)
Top

The first 2 bytes of the underlying buffer are reserved for the AddressFamily enumerated value. When the SocketAddress is used to store a serialized IPEndPoint, the third and fourth bytes are used to store port number information. The remaining 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.

Silverlight

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft