Jump to main content

##

# TCP_SOCKET_OPTION Enumeration

## C

    typedef enum {
    TCP_OPTION_LINGER,
    TCP_OPTION_KEEP_ALIVE,
    TCP_OPTION_RX_BUFF,
    TCP_OPTION_TX_BUFF,
    TCP_OPTION_RX_TMO,
    TCP_OPTION_TX_TMO,
    TCP_OPTION_NODELAY,
    TCP_OPTION_EXCLUSIVE_ADDRESS,
    TCP_OPTION_THRES_FLUSH,
    TCP_OPTION_DELAY_SEND_ALL_ACK,
    TCP_OPTION_TX_TTL,
    TCP_OPTION_TOS
    } TCP_SOCKET_OPTION;

## Description

Enumeration: TCP_SOCKET_OPTION.

This enumeration defines TCP socket run-time options.

## Parameters

Parameters | Description
--- | ---
TCP_OPTION_LINGER | The LINGER option controls the action taken when unsent data is queued on a socket and the socket is closed. The linger option can be turned on/off and the timeout can be specified.
TCP_OPTION_KEEP_ALIVE | Enable the use of keep-alive packets on TCP connections. The option can be turned on/off and the timeout can be specified.
TCP_OPTION_RX_BUFF | Request different RX buffer size. Has to call TCPIP_TCP_OptionsGet to see the exact space allocated.
TCP_OPTION_TX_BUFF | Request different TX buffer size. Has to call TCPIP_TCP_OptionsGet to see the exact space allocated.
TCP_OPTION_RX_TMO | Specifies the RX timeout. If no data arrives in the specified timeout the socket is closed.
TCP_OPTION_TX_TMO | Specifies the TX timeout. If no data can be sent in the specified timeout the socket is closed.
TCP_OPTION_NODELAY | Enables the NO DELAY/Nagle algorithm functionality. The default setting is disabled.
TCP_OPTION_EXCLUSIVE_ADDRESS | Enables a socket to be bound for exclusive access. The default setting is disabled - option not supported yet.
TCP_OPTION_THRES_FLUSH | Sets the type of half buffer TX flush for the socket. The default setting is TCP_OPTION_THRES_FLUSH_AUTO.
TCP_OPTION_DELAY_SEND_ALL_ACK | Enables/disables the delay of sending the pending data when no unacknowledged data. When this option is disabled, the socket will immediately send any pending data chunk whenever all the previous data is acknowledged by the remote party (there is no unacknowledged data). This holds true for the 1st transmission too, or after a pause of some length. If the option is enabled, the socket will delay sending the data, waiting for more data to accumulate. This could be useful when the application makes multiple calls with small data chunks. The default setting is disabled.
TCP_OPTION_TX_TTL | Specifies the Time To Live for packets sent by the socket. If 0, the socket will use the default global IPv4 TTL setting. This option allows the user to specify a different TTL value.
TCP_OPTION_TOS | Sets the Type of Service (TOS) for IPv4 packets sent by the socket.