TCPIP_UDP_DestinationIPAddressSet Function
C
bool TCPIP_UDP_DestinationIPAddressSet(UDP_SOCKET hUDP, IP_ADDRESS_TYPE addType, IP_MULTI_ADDRESS* remoteAddress);
Returns
- true - Indicates success
- false - Indicates failure:
- invalid socket
- invalid socket address type
- socket is of broadcast type
Description
- It sets the IP destination address This allows changing the IP destination address dynamically.
Remarks
The call will fail if the socket was previously set to broadcast using the TCPIP_UDP_OptionsSet call. TCPIP_UDP_OptionsSet takes precedence. The call will fail if remoteAddress is 0. The destination IP address will not be changed.
Preconditions
UDP initialized UDP socket should have been opened with TCPIP_UDP_ServerOpen()/TCPIP_UDP_ClientOpen()(). hUDP - valid socket remoteAddress - valid address pointer
Parameters
Parameters | Description |
---|---|
hUDP | the UDP socket |
addType | Type of address: IPv4/IPv6 |
remoteAddress | pointer to an address to use |