Jump to main content

##

# TCPIP_UDP_DestinationPortSet Function

## C

    bool TCPIP_UDP_DestinationPortSet(UDP_SOCKET s, UDP_PORT remotePort);

## Returns

- true - Indicates success
- false - Indicates an invalid socket

## Description

This function sets the destination port, which allows changing the destination port dynamically.

## Remarks

The destination remote port will always be changed, even if remotePort == 0. It will not change the UDP_OPTION_STRICT_PORT on the socket.

## Preconditions

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

## Parameters

Parameters | Description
--- | ---
hUDP | the UDP socket
remotePort | destination port to use