Important: The information in this document is obsolete and should not be used for new development.
TCP Options
You can use the options in this section with a protocol level ofINET_TCP
. These TCP options are not association-related. They may be negotiated in all endpoint states exceptT_UNBND
andT_UNINIT
. They are read-only in stateT_UNBND
.
#define TCP_NODELAY 0x01 #define TCP_MAXSEG 0x02 #define TCP_NOTIFY_THRESHOLD 0x10 #define TCP_ABORT_THRESHOLD 0x11 #define TCP_CONN_NOTIFY_THRESHOLD 0x12 #define TCP_CONN_ABORT_THRESHOLD 0x13 #define TCP_OOBINLINE 0x14 #define TCP_URGENT_PTR_TYPE 0x15 #define TCP_KEEPALIVE OPT_KEEPALIVEOption descriptions
The
TCP_NODELAY
- Sets the TCP delay mode. (
UInt32
)
- By default, when TCP has a full segment's worth of outgoing data, it sends the segment immediately. However, if it receives less than a segment's worth of outgoing data and has not yet received acknowledgment for the last packet sent, it saves the data until it receives a full segment's worth, or it receives acknowledgment for the last packet, or a timeout period has expired. (In this context, a full segment is the maximum-sized unit of data that can be sent by TCP at one time and a packet is data that is transmitted as a single unit.)
- Specify
T_YES
for this option to cause all data to be sent immediately. SpecifyT_NO
to return TCP to the default delay mode. A request to set this option to no delay is an absolute requirement. This means that TCP must support the option, not that the client must use it.
TCP_MAXSEG
- Read the maximum TCP segment size. (
UInt32
)
- The maximum segment size is returned as an unsigned long specifying the number of bytes. This option is read-only.
TCP_KEEPALIVE
- Activates the keep-alive timer. (
UInt32
). The default setting is off.
- If this option is set
on
, TCP monitors idle connections and sends a keep-alive packet to check a connection after a preset time has expired. You use at_kpalive
structure, described later in this section, to specify the value of this option. The default state for the keep-alive timer isoff
. A request to activate or deactivate the keep-alive timer is an absolute requirement.
TCP_KEEPALIVE
option uses at_kpalive
structure, defined as follows:
struct t_kpalive { long kp_onoff; long kp_timeout; / };
Field Description
kp_onoff
- Activate or deactivate the keep-alive timer. Set this field to
T_YES
to activate the timer or toT_NO
to deactivate it. A request to activate or deactivate the timer is an absolute requirement. The default value of this field isT_NO
. The Open Transport TCP implementation does not support the valueT_YES|T_GARBAGE
for this field.kp_timeout
- Set the requested timeout value, in minutes. Specify a value of
T_UNSPEC
to use the default value. You may specify any positive value for this field of 120 minutes or greater. The timeout value is not an absolute requirement; if you specify a value less than 120 minutes, TCP will renegotiate a timeout of 120 minutes.