Important: The information in this document is obsolete and should not be used for new development.
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 exceptOTSnd
) using thelen
andbuf
fields of aTNetBuf
type structure. Open Transport also allows you to send noncontiguous data-- data stored in several locations, by using theOTData
structure to describe that data and passing it as the data buffer. You can send noncontiguous data using the functionsOTSnd
,OTSndUData
,OTSndURequest
,OTSndUReply
,OTSndRequest
, andOTSndReply
.
Figure 10-1 shows how you use
- Note
- The
OTData
structure and its use in describing noncontiguous data is an Apple extension to the XTI API.OTData
structures to describe noncontiguous data.Figure 10-1 Describing noncontiguous data
The first structure,
myOTD1
, contains information about the first data fragment: thefData
field contains the starting address of the fragment, and thefLen
field contains the length of the fragment. The fieldfNext
contains the address of theOTData
structure,myOTD2
, which specifies the size and location of the second fragment. In turn, the structuremyOTD2
contains the address of theOTData
structure that specifies the location and size of the third fragment. You must set thefNext
field of the lastOTData
structure toNULL
.When sending noncontiguous data (using the functions
OTSnd
,OTSndUData
,OTSndURequest
,OTSndUReply
,OTSndRequest
, andOTSndReply
), thebuf
field of theTNetBuf
structure (or thebuf
parameter to the function) must point to anOTData
structure that describes the first data fragment. You must also set thelen
field of theTNetBuf
structure (or thenbytes
parameter to the function) tokNetbufDataIsOTData
.