UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
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 小于 1024
注解
构造 UdpSingleSourceMulticastClient 函数将 UDP 多播套接字与组地址和端口相关联,但不绑定或使用套接字。
该 groupAddress 参数可以是 IPv6 或 IPv4 多播地址。 但是,地址系列 sourceAddress 和 groupAddress 参数必须相同。
参数 localPort 不能指定小于 1,024 的端口。