System.Net.Sockets.UdpClient.DropMulticastGroup Method

Leaves a multicast group.

Syntax

public void DropMulticastGroup (System.Net.IPAddress multicastAddr, int ifindex)

Parameters

multicastAddr
The System.Net.IPAddress of the multicast group to leave.
ifindex
The local address of the multicast group to leave.

Remarks

The UdpClient.DropMulticastGroup(System.Net.IPAddress, int) method withdraws the System.Net.Sockets.UdpClient from the multicast group identified by the specified System.Net.IPAddress. After calling the UdpClient.DropMulticastGroup(System.Net.IPAddress, int) method, the underlying System.Net.Sockets.Socket sends an Internet Group Management Protocol (IGMP) packet to the router, removing the router from the multicast group. After a System.Net.Sockets.UdpClient withdraws from the group, it will no longer be able to receive datagrams sent to that group.

Note:

If you receive a System.Net.Sockets.SocketException, use the SocketException.ErrorCode property to obtain the specific error code. After you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0