UdpSingleSourceMulticastClient(IPAddress, IPAddress, Int32) 构造函数
定义
注意
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
创建一个可以订阅组地址并从单一源接收数据报的新 UdpSingleSourceMulticastClient UDP 客户端。Creates a new UdpSingleSourceMulticastClient UDP client that can subscribe to a group address and receive datagrams from a single source.
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
此接收器要订阅的发送器源地址。The sender source address for this receiver to subscribe to.
- groupAddress
- IPAddress
此接收器要订阅的多播组地址。The multicast group address for this receiver to subscribe to.
- localPort
- Int32
此接收器要绑定到的本地端口。The local port for this receiver to bind to.
- 属性
例外
sourceAddress 和 groupAddress 必须为相同地址族。sourceAddress and groupAddress must be the same address family.
sourceAddress 为 null 引用(在 Visual Basic 中为 Nothing)。sourceAddress is a null reference (Nothing in Visual Basic).
- 或 --or-
groupAddress 为 null 引用(在 Visual Basic 中为 Nothing)。groupAddress is a null reference (Nothing in Visual Basic).
localPort 小于 0localPort is less than 0
- 或 --or-
localPort 大于 65,535。localPort is greater than 65,535.
localPort 小于 1024localPort is less than 1024
注解
UdpSingleSourceMulticastClient构造函数将 UDP 多播套接字与组地址和端口关联,但不绑定或以其他方式使用套接字。The UdpSingleSourceMulticastClient constructor associates a UDP multicast socket with a group address and port, but does not bind or otherwise use the socket.
参数可以是 groupAddress IPv6 或 IPv4 多播地址。The groupAddress parameter may be either an IPv6 or IPv4 multicast address. 但是,和参数的地址族 sourceAddress groupAddress 必须相同。However, the address family of the sourceAddress and groupAddress parameters must the same.
localPort参数不得指定小于1024的端口。The localPort parameter must not specify a port less than 1,024.