語言

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 多播位址。 然而,與sourceAddress參數的groupAddress地址族必須相同。

參數 localPort 不得指定小於 1,024 的埠。

適用於