SocketAddress Constructor (AddressFamily, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Creates a new instance of the SocketAddress class using the specified address family and buffer size.

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

Syntax

'Declaration
Public Sub New ( _
    family As AddressFamily, _
    size As Integer _
)
public SocketAddress(
    AddressFamily family,
    int size
)

Parameters

  • size
    Type: System.Int32
    The value to set for the Size property which affects the number of bytes to allocate for the underlying buffer.

Exceptions

Exception Condition
ArgumentOutOfRangeException

size is less than 2. These 2 bytes are needed to store family.

Remarks

Use this constructor to create a new instance of the SocketAddress class with a particular value for the Size property and the associated underlying buffer size. The Size property is less than the associated buffer size by a fixed amount.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

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