TCPIP_UDP_BcastIPV4AddressSet Function

C

bool TCPIP_UDP_BcastIPV4AddressSet(UDP_SOCKET hUDP, UDP_SOCKET_BCAST_TYPE bcastType, TCPIP_NET_HANDLE hNet); 

Returns

  • true - Indicates success

  • false - Indicates failure:

  • invalid socket

  • invalid socket address type

  • a broadcast for the specified interface could not be obtained

  • invalid broadcast type specified

Description

It sets the broadcast address for the socket

Remarks

This function allows changing of the destination IPv4 address dynamically. However, the call will fail if the socket was previously set to broadcast using the TCPIP_UDP_OptionsSet call. TCPIP_UDP_OptionsSet takes precedence.

Preconditions

UDP initialized UDP socket should have been opened with TCPIP_UDP_ServerOpen()/TCPIP_UDP_ClientOpen()(). hUDP - valid socket

Parameters

ParametersDescription
hUDPthe UDP socket
bcastTypeType of broadcast
hNethandle of an interface to use for the network directed broadcast Not used for network limited broadcast