Jump to main content

##

# TCPIP_UDP_OptionsSet Function

## C

    bool TCPIP_UDP_OptionsSet(UDP_SOCKET hUDP, UDP_SOCKET_OPTION option, void* optParam);

## Returns

- true - Indicates success
- false - Indicates failure

## Description

Various options can be set at the socket level.

## Remarks

Changing the UDP_OPTION_BUFFER_POOL will discard the data in the current socket buffer

- UDP_OPTION_TX_BUFF - 16-bit value in bytes of the TX buffer the UDP_OPTION_TX_BUFF will discard the data in the current socket buffer
- UDP_OPTION_TX_QUEUE_LIMIT - 8-bit value of the TX queue limit
- UDP_OPTION_RX_QUEUE_LIMIT - 8-bit value of the RX queue limit
- UDP_OPTION_RX_AUTO_ADVANCE - boolean enable/disable
- UDP_OPTION_TX_TTL - 8-bit value of TTL
- UDP_OPTION_MULTICAST - pointer to a UDP_OPTION_MULTICAST_DATA structure
- UDP_OPTION_TOS - 8-bit value of the TOS
- UDP_OPTION_DF - boolean - true: no fragmentation allowed; false: fragmentation allowed This function provides the run-time functionality required to implement some of the standard BSD socket options API.

## Preconditions

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

## Parameters

Parameters | Description
--- | ---
hUDP | socket to set options for
option | specific option to be set
optParam | the option value; this is option dependent: - UDP_OPTION_STRICT_PORT - boolean enable/disable - UDP_OPTION_STRICT_NET - boolean enable/disable - UDP_OPTION_STRICT_ADDRESS - boolean enable/disable - UDP_OPTION_BROADCAST -UDP_SOCKET_BCAST_TYPE - UDP_OPTION_BUFFER_POOL - boolean enable/disable