Admin Production ni-theme
Current Publication

UDPMulticastUnsubscribe

LabWindows/CVI

UDPMulticastUnsubscribe

int UDPMulticastUnsubscribe (unsigned int channel, const char *multicastAddress, const char *sourceAddress);

Purpose

Unsubscribes the channel from a multicast address or from a particular source of multicast traffic.

If you call UDPMulticastUnsubscribe without specifying a sourceAddress, the function cancels a multicast subscription previously initiated by a call to UDPMulticastSubscribe.

If you specify a sourceAddress, UDPMulticastUnsubscribe blocks the receipt of all multicast datagrams for the specified address that originate from the specified source. You can later unblock a particular source by calling UDPMulticastSubscribe.

(RT)  Source address filtering is not supported on the LabWindows/CVI Real-Time Module.

Parameters

Input
Name Type Description
channel unsigned int A handle that uniquely identifies an open UDP communication endpoint.
multicastAddress const char * The multicast address from which to unsubscribe.

You must pass a string representing a valid multicast IP address in dot-decimal format, such as 235.1.2.3. Valid multicast addresses (Class D) range from 224.0.0.0 to 239.255.255.255.
sourceAddress const char * The IP address or host name from which to block multicast datagrams.

This parameter enables filtering of incoming datagrams for the multicast address such that the channel does not receive datagrams that originate from the specified source.

To block a particular source host, pass a string representing the host IP address in dot-decimal notation, such as 127.0.0.1, or pass an alphanumeric string representing the host name, such as HAL9000.

To completely unsubcribe from the multicast address, pass NULL.

(RT)  This parameter is ignored. The function behaves as if NULL were passed.

Return Value

Name Type Description
status int Return value indicating whether the function was successful.

Zero indicates successful execution and a negative number indicates that an error occurred.

Call the GetUDPErrorString function to obtain a message that describes the error.

Additional Information

Library: UDP Support Library

Include file: udpsupp.h

LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later

Example

Refer to udp\UDPWriter.cws for an example of using the UDPMulticastUnsubscribe function.