|LabWindows/CVI 2010 Help||LabWindows/CVI 2012 Help||LabWindows/CVI 2013 Help||LabWindows/CVI 2015 Help||LabWindows/CVI 2017 Help|
int UDPMulticastSubscribe (unsigned int channel, const char *multicastAddress, const char *sourceAddress);
Enables the channel to receive datagrams sent to the specified multicast address.
UDPMulticastSubscribe forwards any datagrams sent to the multicastAddress to the channel's network interface. As with any other incoming datagram, the channel receives datagrams addressed only to its port number.
You also can provide a sourceAddress to receive only datagrams originating from a particular host machine. You can call UDPMulticastSubscribe repeatedly to subscribe a channel to multiple multicast addresses or to multiple sources for the same multicast address.
(RT) Source address filtering is not supported on the LabWindows/CVI Real-Time Module.
Call UDPMulticastUnsubscribe to drop a multicast subscription or block multicast datagrams from a particular source address. You can then call UDPMulticastSubscribe to subscribe again or to unblock the source address.
You can call SetUDPAttribute to set various multicast transmission attributes such as the output interface, datagram time-to-live (TTL), and loopback behavior.
|Note Unless your Local Area Network (LAN) contains a special multicast-capable router supporting Internet Group Management Protocol (IGMP), you cannot send or receive multicast datagrams across your LAN boundary. Successful multicast datagram transmission across a Wide Area Network (WAN) requires the following:
|channel||unsigned int||A handle that uniquely identifies an open UDP communication endpoint.|
|multicastAddress||const char *||The multicast address to which to subscribe.
You must pass a string representing a valid multicast IP address in dot-decimal format, such as 22.214.171.124. Valid multicast addresses (Class D) range from 126.96.36.199 to 188.8.131.52.
|sourceAddress||const char *||The IP address or host name from which to accept multicast datagrams.
To enable source filtering, pass only the address of the host from which the channel will receive datagrams. The host address must be an IP address in dot-decimal notation, such as 127.0.0.1, or an alphanumeric string representing the host name, such as HAL9000.
To accept datagrams from all sources, pass NULL.
(RT) This parameter is ignored. The function behaves as if NULL were passed.
|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.
Library: UDP Support Library
Include file: udpsupp.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later
Refer to the following examples that use the UDPMulticastSubscribe function: