Important: The information in this document is obsolete and should not be used for new development.
OTRcvUData
Reads data sent to a connectionless transactionless protocol.C INTERFACE
OSStatus OTRcvUData(EndpointRef ref, TUnitData* udata, OTFlags* flag);C++ INTERFACE
OSStatus TEndpoint::RcvUData(TUnitData* udata, OTFlags* flag);PARAMETERS
ref- The endpoint reference of the endpoint receiving the data.
udata
- A pointer to a
TUnitDatastructure that, on return, contains information about the data that has been received.
- The
udata->addr.buffield is a pointer to a buffer that is filled with the address of the endpoint that has sent the data. You must allocate this buffer and set theudata->addr.maxlenfield to the size of the buffer.
- The
udata->opt.buffield is a pointer to a buffer that is filled with any association-related options specified by the endpoint sending data. To read these options, you must allocate a buffer into which the provider can place the options and you must set theopt.maxlenfield to the size of the buffer.
- The
udata->udata.buffield is a pointer to a buffer in which the function stores data when it returns. You must allocate a buffer for the data and set theudata.maxlenfield to the size of the buffer.
flag
- A pointer to an unsigned long variable whose bit setting, on return, indicates whether you need to retrieve more data. If the
T_MOREis set, there is more data; if it is clear, there is no more data.
- function result
- An error code. See Discussion.
DISCUSSION
TheOTRcvUDatafunction returns information about the data read into theTUnitDatastructure.The
OTFlagsvariable, referenced by theflagparameter, indicates whether there is more data to be retrieved in this packet. If the buffer referenced by theudata->udata.buffield is not large enough to hold the current data unit, the endpoint provider fills the buffer and sets theflagparameter toT_MOREto indicate that you must call theOTRcvUDatafunction again to receive additional data. Subsequent calls to theOTRcvUDatafunction return 0 for the length of the address and option buffers until you receive the full data unit. The last part of the unit received does not have theT_MOREflag set.If the endpoint is in asynchronous mode or is not blocking and data is not available, the
OTRcvUDatafunction fails with thekOTNoDataErrresult. The endpoint provider uses theT_DATAevent to notify the endpoint when data becomes available. You can use a notifier function or theOTLookfunction to retrieve the event. Once you get theT_DATAevent, you should continue calling theOTRcvUDatafunction until it returns thekOTNoDataErrresult.It is possible to receive a
T_DATAevent, but when you execute theOTRcvUDatafunction, it returns with akOTNoDataErrresult. If this happens, you should continue as though you just finished reading all the data.SPECIAL CONSIDERATIONS
TheXTI_RCVLOWAToption allows endpoints that support it to negotiate the minimum number of bytes that must have accumulated in the endpoint's internal receive buffer before the endpoint provider generates aT_DATAevent. See "Option Management" for information on setting this option.SEE ALSO
"AppleTalk Reference".
 
  
  
  