Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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);

Example

[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
m_t.Abort()

' Abandon the multicast group.
clientOriginator.DropMulticastGroup(m_GrpAddr)


[C#] 

      // 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
      m_t.Abort();

      // Abandon the multicast group.
      clientOriginator.DropMulticastGroup(m_GrpAddr);


[C++] 
// 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
m_t->Abort();

// Abandon the multicast group.
clientOriginator->DropMulticastGroup(m_GrpAddr);

[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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.