Jump to main content

##

# TCPIP_UDP_SourceIPAddressSet Function

## C

    bool TCPIP_UDP_SourceIPAddressSet(UDP_SOCKET hUDP, IP_ADDRESS_TYPE addType, IP_MULTI_ADDRESS* localAddress);

## Returns

- true - Indicates success
- false - Indicates failure:
- invalid socket
- invalid socket address type
- unspecified localAddress

## Description

This function sets the IP source address, which allows changing the source P address dynamically.

## Remarks

The call will fail if localAddress is 0. The source 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 localAddress - valid address pointer

## Parameters

Parameters | Description
--- | ---
hUDP | the UDP socket
addType | Type of address: IPv4/IPv6
localAddress | pointer to an address to use