Important: The information in this document is obsolete and should not be used for new development.
OTAckSends
Specifies that a provider not make an internal copy of data being sent.C INTERFACE
OSStatus OTAckSends(ProviderRef ref);C++ INTERFACE
OSStatus TProvider::AckSends();PARAMETERS
ref- The provider reference of the provider that is sending data.
- function result
- An error code. See Appendix B for more information.
DISCUSSION
By default, providers make an internal copy of data before sending it and they do not acknowledge sends. If you use theOTAckSendsfunction to specify that the provider acknowledge sends and you call a function that sends data, the provider does not copy the data before sending it. Instead, it reads data directly from your buffer while sending. For this reason, you must not change the contents of your buffer until the provider is no longer using it. The provider lets you know that it has finished using the buffer by calling your notifier function and passing theT_MEMORYRELEASEDevent code for thecodeparameter, a pointer to the buffer that was sent in thecookieparameter, and the size of the buffer in theresultparameter. TheT_MEMORYRELEASEDevent is not serialized with other notification events and will re-enter your notifier function.If you have not installed a notifier function for the provider, this function returns the
kOTAccessErrresult. If a send is currently outstanding on the provider, from a call to theOTSnd,OTSndUData,OTSndUReply,OTSndURequest,OTSndReply, orOTSndRequestfunctions, theOTAckSendsfunction returns akOTChangeStateErrmessage.Although you must wait for a
T_MEMORYRELEASEDevent before you touch the buffer containing the data being sent, you do not have to wait for aT_MEMORYRELEASEDevent to send more data. You can continue to process data normally, sending data until you get a flow error and then resuming sends when you receive theT_GODATAevent.
To find out a provider's current send-acknowledgment mode, call the
- WARNING
- You need to be sure there are no outstanding
T_MEMORYRELEASEDevents for a provider before you close the provider. Otherwise, Open Transport attempts to deliver the event to a provider that no longer exists, with unpredictable results, such as crashing the system.![]()
OTIsAckingSendsfunction.The send-acknowledgment mode of a provider is ignored by mapper providers, AppleTalk service providers, and TCP/IP service providers.
COMPLETION EVENT CODES
T_MEMORYRELEASEDSPECIAL CONSIDERATIONS
Because of the complexity of handling flow control, Open Transport performance suffers when the acknowledge sends option is used with noncontiguous data, such as when you pass anOTDatastructure to theOTSndfunction. It is best to use this option with contiguous data or withOTDatastructures whose last element is large.SEE ALSO
TheOTDontAckSendsfunction."Setting a Provider's Send-Acknowledgment Status".
See the chapter "Advanced Topics" for more information about acknowledging sends.