Share via


UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) 构造函数

定义

注意

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

创建一个可以订阅组地址并从单一源接收数据报的新 UdpSingleSourceMulticastClient UDP 客户端。

public:
 UdpSingleSourceMulticastClient(System::Net::IPAddress ^ sourceAddress, System::Net::IPAddress ^ groupAddress, int localPort);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public UdpSingleSourceMulticastClient (System.Net.IPAddress sourceAddress, System.Net.IPAddress groupAddress, int localPort);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
new System.Net.Sockets.UdpSingleSourceMulticastClient : System.Net.IPAddress * System.Net.IPAddress * int -> System.Net.Sockets.UdpSingleSourceMulticastClient
Public Sub New (sourceAddress As IPAddress, groupAddress As IPAddress, localPort As Integer)

参数

sourceAddress
IPAddress

此接收器要订阅的发送器源地址。

groupAddress
IPAddress

此接收器要订阅的多播组地址。

localPort
Int32

此接收器要绑定到的本地端口。

属性

例外

sourceAddressgroupAddress 必须为相同地址族。

sourceAddress 为 null 引用(在 Visual Basic 中为 Nothing)。

- 或 -

groupAddress 为 null 引用(在 Visual Basic 中为 Nothing)。

localPort 小于 0

- 或 -

localPort 大于 65,535。

localPort 小于 1024

注解

构造 UdpSingleSourceMulticastClient 函数将 UDP 多播套接字与组地址和端口相关联,但不绑定或以其他方式使用该套接字。

参数 groupAddress 可以是 IPv6 或 IPv4 多播地址。 但是,和 groupAddress 参数的sourceAddress地址系列必须相同。

参数 localPort 不能指定小于 1,024 的端口。

适用于