Important: The information in this document is obsolete and should not be used for new development.
OTSndUData
Sends data using a connectionless transactionless endpoint.C INTERFACE
OSStatus OTSndUData(EndpointRef ref, TUnitData* udata);C++ INTERFACE
OSStatus TEndpoint::SndUData(TUnitData* udata);PARAMETERS
ref- The endpoint reference of the endpoint sending the data.
udata- A pointer to a
TUnitDatastructure that specifies the data to be sent, its destination, and any options for this send.
- The
udata->addr.buffield is a pointer to a buffer that contains the address to which the data is sent. You must initialize the buffer, and set theudata->addr.lenfield to the size of the address.
- The
udata->opt.buffield is a pointer to a buffer that contains option information. Store option information in the buffer and set theudata->opt.lenfield to the size of the options. If you do not want to specify any options, set this field to 0.
- The
udata->udata.buffield is a pointer to a buffer that contains data to be sent. Set theudata->udata.lenfield to the size of the data.
- function result
- An error code. See Discussion.
DISCUSSION
TheOTSndUDatafunction sends data to the address specified by theudata->addrfield of theudataparameter. If the endpoint does not support sending 0 bytes or if the amount of data exceeds the TSDU size for the endpoint, the function returns with the resultkOTBadDataErr.If the endpoint is in synchronous blocking mode, the
OTSndUDatafunction returns when the send is complete. If flow-control restrictions prevent its sending the data, it retries the operation until it is able to send it.If the endpoint is in nonblocking or asynchronous mode, the
OTSndUDatafunction returns akOTFlowErrresult if flow-control restrictions prevent the data from being sent. When the endpoint provider is able to send the data, it sends your notifier function, aT_GODATAevent. You can then call theOTSndUDatafunction from your notifier to send the data. You can also retrieve this event by polling the endpoint using theOTLookfunction.The next table shows how the endpoint's modes of operation and blocking status affects the behavior of the
OTSndUDatafunction.
Blocking Nonblocking Synchronous The function returns when the provider lifts flow-control restrictions. The function returns immediately. The kOTFlowErrresult is never returned.The kOTFlowErrresult might be returned.Asynchronous The function returns immediately. The function returns immediately. The kOTFlowErrresult might be returned.The kOTFlowErrresult might be returned.SPECIAL CONSIDERATIONS
Some endpoint providers are not able to detect immediately whether you specified incorrect address or option information. Because of this, the provider calls your notifier function when it detects the error, passing theT_UDERRevent code for thecodeparameter to advise you that an error has occurred. You can determine the cause of this event by calling theOTRcvUDErrfunction and examining the value of theuderr->errorparameter. It is important that you call theOTRcvUDErrfunction even if you are not interested in examining the cause of the error. Failing to do this leaves the endpoint in a state where it cannot do other sends, nor deallocate memory reserved for internal buffers associated with the send.The
XTI_SNDLOWAToption allows endpoints that support it to negotiate the minimum number of bytes that must have accumulated in the endpoint's internal send buffer before they are sent. See "Option Management" for information on setting this option.SEE ALSO
TheOTRcvUDatafunction.
 
  
  
  