Important: The information in this document is obsolete and should not be used for new development.
Determining Which Function to Use to Negotiate Options
You can negotiate options using theOTOptionManagement
function or using any one of the endpoint functions used to transfer data or establish a connection. The following summarizes the major differences between using theOTOptionManagement
function or using other endpoint functions to set an option value.
- Options specified using the
OTOptionManagement
function affect all functions called by an endpoint. Options specified using individual endpoint functions affect only the connection, transaction, or datagram for which they are set. For example, you can call theOTOptionManagement
function to turn the checksum option on; you could override that value by calling theOTSndUData
function and turning the checksum option off for the duration of that function call. The next time you call theOTSndUData
function, the default value, set with theOTOptionManagement
function would apply, so the checksum option would be on.
- The
OTOptionManagement
function is the only way that you can obtain default option values or check for current values of all options supported by an endpoint.
- When attempting to set multiple options, if an option is illegal or rejected, the
OTOptionManagement
function still returns successfully, indicating for each option in the buffer whether it has been successfully negotiated. In the same circumstances, any other function returns an error, and even though some of the options might have been successfully negotiated, you have no way of knowing which were and which were not.
- If you are using the
OTOptionManagement
function to set or verify option values, all options in the buffer must be for the same protocol. If you use any other function to negotiate options or to check their value, the buffer can contain options for different protocols.
- If association-related options contain information that is transmitted across the network or if they affect the transmission itself, they take effect when Open Transport establishes the connection, sends the transaction, or transmits the datagram. If you use the
OTOptionManagement
function to change such an option, the endpoint provider checks whether the option is supported and negotiates a value according to its current knowledge. Then it writes the negotiated value to the endpoint's internal options buffer. However, more negotiations might take place when the connection is established or the transaction or datagram is sent. This can result in a degradation of the option value or even in a negotiation failure. If the negotiation succeeds, the newly negotiated values are written to the internal options buffer.