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

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

属性

例外

sourceAddress 并且 groupAddress 必须是同一地址系列。

sourceAddress 是空引用(Visual Basic 中没有任何内容)。

-或-

groupAddress 是空引用(Visual Basic 中没有任何内容)。

localPort 小于 0

-或-

localPort 大于 65,535。

localPort 小于 1024

注解

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

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

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

适用于