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 的埠。

適用於