Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 29 - TCP/IP Services Reference / Options


TCP Options

You can use the options in this section with a protocol level of INET_TCP. These TCP options are not association-related. They may be negotiated in all endpoint states except T_UNBND and T_UNINIT. They are read-only in state T_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_KEEPALIVE
Option descriptions

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. Specify T_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 a t_kpalive structure, described later in this section, to specify the value of this option. The default state for the keep-alive timer is off. A request to activate or deactivate the keep-alive timer is an absolute requirement.

The TCP_KEEPALIVE option uses a t_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 to T_NO to deactivate it. A request to activate or deactivate the timer is an absolute requirement. The default value of this field is T_NO. The Open Transport TCP implementation does not support the value T_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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998