This documentation is archived and is not being maintained.

UdpClient.DropMulticastGroup Method

Leaves a multicast group.

Overload List

Leaves a multicast group.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Sub DropMulticastGroup(IPAddress)
[C#] public void DropMulticastGroup(IPAddress);
[C++] public: void DropMulticastGroup(IPAddress*);
[JScript] public function DropMulticastGroup(IPAddress);

[Visual Basic] Overloads Public Sub DropMulticastGroup(IPAddress, Integer)
[C#] public void DropMulticastGroup(IPAddress, int);
[C++] public: void DropMulticastGroup(IPAddress*, int);
[JScript] public function DropMulticastGroup(IPAddress, int);


[Visual Basic, C#, C++] The following example demonstrates how to drop a multicast group by providing a multicast address.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of DropMulticastGroup. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
' Send data to ClientTarget.
Console.WriteLine(ControlChars.Lf + "The ClientOriginator sent:" + ControlChars.Lf)
Send.OriginatorSendData(clientOriginator, m_ClientTargetdest)

' Receive data from ClientTarget
Ret = Receive.ReceiveUntilStop(clientOriginator)

' Stop the ClientTarget thread

' Abandon the multicast group.


      // Send data to ClientTarget.
      Console.WriteLine("\nThe ClientOriginator sent:\n");
      Send.OriginatorSendData(clientOriginator, m_ClientTargetdest);
      // Receive data from ClientTarget
      Ret = Receive.ReceiveUntilStop(clientOriginator);

      // Stop the ClientTarget thread

      // Abandon the multicast group.

// Send data to ClientTarget.
Console::WriteLine(S"\nThe ClientOriginator sent:\n");
Send::OriginatorSendData(clientOriginator, m_ClientTargetdest);

// Receive data from ClientTarget
Ret = Receive::ReceiveUntilStop(clientOriginator);

// Stop the ClientTarget thread

// Abandon the multicast group.

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

UdpClient Class | UdpClient Members | System.Net.Sockets Namespace