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 1 - Open Transport Essentials
Chapter 10 - Advanced Topics


Sending Noncontiguous Data

When sending data, you specify the location and size of the buffer containing the data to be sent (for all send functions except OTSnd) using the len and buf fields of a TNetBuf type structure. Open Transport also allows you to send noncontiguous data-- data stored in several locations, by using the OTData structure to describe that data and passing it as the data buffer. You can send noncontiguous data using the functions OTSnd, OTSndUData, OTSndURequest, OTSndUReply, OTSndRequest, and OTSndReply.

Note
The OTData structure and its use in describing noncontiguous data is an Apple extension to the XTI API.
Figure 10-1 shows how you use OTData structures to describe noncontiguous data.

Figure 10-1 Describing noncontiguous data

The first structure, myOTD1, contains information about the first data fragment: the fData field contains the starting address of the fragment, and the fLen field contains the length of the fragment. The field fNext contains the address of the OTData structure, myOTD2, which specifies the size and location of the second fragment. In turn, the structure myOTD2 contains the address of the OTData structure that specifies the location and size of the third fragment. You must set the fNext field of the last OTData structure to NULL.

When sending noncontiguous data (using the functions OTSnd, OTSndUData, OTSndURequest, OTSndUReply, OTSndRequest, and OTSndReply), the buf field of the TNetBuf structure (or the buf parameter to the function) must point to an OTData structure that describes the first data fragment. You must also set the len field of the TNetBuf structure (or the nbytes parameter to the function) to kNetbufDataIsOTData.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998