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 25 - Option Management Reference / Constants and Data Types


Generic Options

Open Transport defines some generic options that you can use with any protocol that supports them. The protocol level for each of these options is the same as the name of the protocol that supports them. The constant names used to specify generic options are given by the following enumeration:

enum
{
   OPT_CHECKSUM      = (OTXTIName)0x0600,
   OPT_RETRYCNT      = (OTXTIName)0x0601, 
   OPT_INTERVAL      = (OTXTIName)0x0602, 
   OPT_ENABLEEOM     = (OTXTIName)0x0603,
   OPT_SELFSEND      = (OTXTIName)0x0604,
   OPT_SERVERSTATUS  = (OTXTIName)0x0605,
   OPT_KEEPALIVE     = (OTXTIName)0x0008
   OPT_ALERTENABLE   = (OTXTIName)0x0606,
};
Constant descriptions

OPT_CHECKSUM
A 32-bit constant specifying whether checksums are performed. Specify 1 to turn the option on and 0 to turn it off. If you turn it on, a checksum is calculated when a packet is sent and recalculated when the packet is received. If the checksum values match, the client receiving the packet can be fairly certain that data has not been corrupted or lost during transmission. If the checksum values don't match, the receiver discards the packet.

This option is usually implemented by the lowest-level protocol, although you might be allowed to set it at a higher level. For example, if you use an ATP endpoint, you can set checksumming at the ATP level, even though it is implemented by the underlying DDP protocol.

OPT_RETRYCNT
A 32-bit integer specifying the number of times a function can attempt packet delivery before returning with an error. A value of 0 means that the function should attempt packet delivery an infinite number of times.

This option is usually implemented by connection-oriented endpoints or connectionless transaction-based endpoints to enable reliable delivery of data. Such protocols normally set a default value for this option.

OPT_INTERVAL
A 32-bit integer specifying the interval of time in milliseconds that should elapse between attempts to deliver a packet. The number of attempts is defined by the OPT_RETRYCNT option.

OPT_ENABLEEOM
An 32-bit integer specifying end-of-message capability. If you set this option, you enable the use of the T_MORE flag with the OTSnd function to mark the end of a logical unit. This option has meaning only for connection-oriented protocols. A value of 0 clears the option; a value of 1 sets it.

This option is not association-related.

OPT_SELFSEND
A 32-bit integer allowing you to send broadcast packets to yourself. A value of 0 clears the option; a value of 1 sets it.

OPT_SERVERSTATUS
A string that sets the server's status. The maximum length is protocol dependent. For more information, consult the documentation for the protocol you are using.

OPT_KEEPALIVE
A keepalive structure that specifies whether "keep alive" is turned on (T_YES) or off (T_NO) and specifies the timeout period in minutes.

Connection-oriented protocols can use this option to check that the connection is maintained. If a connection is established but there is no data being transferred, you can specify a time limit within which Open Transport checks to see that the remote end of the connection is still alive. If it is not, Open Transport tears down the connection.

This option is association-related.

OPT_ALERTENABLE
Enables or disables protocol alerts.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998