SocketAddress 构造函数

定义

创建 SocketAddress 类的新实例。

重载

SocketAddress(AddressFamily)

为给定的地址族创建 SocketAddress 类的新实例。

SocketAddress(AddressFamily, Int32)

使用指定的地址族和缓冲区大小创建 SocketAddress 类的新实例。

SocketAddress(AddressFamily)

Source:
SocketAddress.cs
Source:
SocketAddress.cs
Source:
SocketAddress.cs

为给定的地址族创建 SocketAddress 类的新实例。

public:
 SocketAddress(System::Net::Sockets::AddressFamily family);
public SocketAddress (System.Net.Sockets.AddressFamily family);
new System.Net.SocketAddress : System.Net.Sockets.AddressFamily -> System.Net.SocketAddress
Public Sub New (family As AddressFamily)

参数

family
AddressFamily

AddressFamily 枚举值。

注解

此重载将基础缓冲区大小设置为 32 个字节。

适用于

SocketAddress(AddressFamily, Int32)

Source:
SocketAddress.cs
Source:
SocketAddress.cs
Source:
SocketAddress.cs

使用指定的地址族和缓冲区大小创建 SocketAddress 类的新实例。

public:
 SocketAddress(System::Net::Sockets::AddressFamily family, int size);
public SocketAddress (System.Net.Sockets.AddressFamily family, int size);
new System.Net.SocketAddress : System.Net.Sockets.AddressFamily * int -> System.Net.SocketAddress
Public Sub New (family As AddressFamily, size As Integer)

参数

family
AddressFamily

AddressFamily 枚举值。

size
Int32

要为基础缓冲区分配的字节数。

例外

size 小于 2。 这两字节需要存储 family

注解

使用此重载创建具有特定基础缓冲区大小的 类的新实例 SocketAddress

适用于