Share via


MulticastOption Konstruktoren

Definition

Initialisiert eine neue Instanz der MulticastOption-Klasse.

Überlädt

MulticastOption(IPAddress)

Initialisiert eine neue Version der MulticastOption-Klasse für die angegebene IP-Multicast-Gruppe.

MulticastOption(IPAddress, Int32)

Initialisiert eine neue Instanz der MulticastOption-Klasse mit der angegebenen IP-Adresse der Multicastgruppe und dem angegebenen Schnittstellenindex.

MulticastOption(IPAddress, IPAddress)

Initialisiert eine neue Instanz der MulticastOption-Klasse mit der Adresse der angegebenen IP-Multicast-Gruppe und der angegebenen lokalen IP-Adresse, die einer Netzwerkschnittstelle zugeordnet ist.

MulticastOption(IPAddress)

Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs

Initialisiert eine neue Version der MulticastOption-Klasse für die angegebene IP-Multicast-Gruppe.

public:
 MulticastOption(System::Net::IPAddress ^ group);
public MulticastOption (System.Net.IPAddress group);
new System.Net.Sockets.MulticastOption : System.Net.IPAddress -> System.Net.Sockets.MulticastOption
Public Sub New (group As IPAddress)

Parameter

group
IPAddress

Die IP-Adresse der Multicastgruppe.

Ausnahmen

group ist null.

Hinweise

Verwenden Sie für Computer mit mehreren Netzwerkkarten diesen Konstruktor nicht. Verwenden Sie den Konstruktor, der eine Gruppe und eine lokale IP-Adresse akzeptiert.

Gilt für:

MulticastOption(IPAddress, Int32)

Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs

Initialisiert eine neue Instanz der MulticastOption-Klasse mit der angegebenen IP-Adresse der Multicastgruppe und dem angegebenen Schnittstellenindex.

public:
 MulticastOption(System::Net::IPAddress ^ group, int interfaceIndex);
public MulticastOption (System.Net.IPAddress group, int interfaceIndex);
new System.Net.Sockets.MulticastOption : System.Net.IPAddress * int -> System.Net.Sockets.MulticastOption
Public Sub New (group As IPAddress, interfaceIndex As Integer)

Parameter

group
IPAddress

Die IP-Adresse der Multicastgruppe.

interfaceIndex
Int32

Der Index der Schnittstelle, die zum Senden und Empfangen von Multicastpaketen verwendet wird.

Gilt für:

MulticastOption(IPAddress, IPAddress)

Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs

Initialisiert eine neue Instanz der MulticastOption-Klasse mit der Adresse der angegebenen IP-Multicast-Gruppe und der angegebenen lokalen IP-Adresse, die einer Netzwerkschnittstelle zugeordnet ist.

public:
 MulticastOption(System::Net::IPAddress ^ group, System::Net::IPAddress ^ mcint);
public MulticastOption (System.Net.IPAddress group, System.Net.IPAddress mcint);
new System.Net.Sockets.MulticastOption : System.Net.IPAddress * System.Net.IPAddress -> System.Net.Sockets.MulticastOption
Public Sub New (group As IPAddress, mcint As IPAddress)

Parameter

group
IPAddress

Die IP-Adresse der Gruppe.

mcint
IPAddress

Die lokale IP-Adresse.

Ausnahmen

group ist null.

- oder -

mcint ist null.

Beispiele

Das folgende Beispiel erstellt eine MulticastOption Objekt.

// Define a MuticastOption object specifying the multicast group
// address and the local IPAddress.
// The multicast group address is the same one used by the server.
mcastOption = gcnew MulticastOption( mcastAddress,localIPAddr );
mcastSocket->SetSocketOption( SocketOptionLevel::IP, SocketOptionName::AddMembership, mcastOption );

// Define a MulticastOption object specifying the multicast group
// address and the local IPAddress.
// The multicast group address is the same as the address used by the server.
s_mcastOption = new MulticastOption(s_mcastAddress, localIPAddr);

s_mcastSocket.SetSocketOption(SocketOptionLevel.IP,
                            SocketOptionName.AddMembership,
                            s_mcastOption);
' Define a MulticastOption object specifying the multicast group 
' address and the local IPAddress.
' The multicast group address is the same as the address used by the server.
mcastOption = New MulticastOption(mcastAddress, localIPAddr)

mcastSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, mcastOption)

Hinweise

Für Computer mit mehreren Netzwerkkarten müssen Sie diesen Konstruktor verwenden, um Instanzen zu erstellen MulticastOption .

Gilt für: