System.Net.Sockets.UdpClient.DropMulticastGroup Method

Leaves a multicast group.

Syntax

public void DropMulticastGroup (System.Net.IPAddress multicastAddr)

Parameters

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

Remarks

The UdpClient.DropMulticastGroup(System.Net.IPAddress) 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) 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 SocketException.ErrorCode to obtain the specific error code. Once 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