Important: The information in this document is obsolete and should not be used for new development.
The No-Copy Receive Buffer Structure
You use the no-copy receive buffer structure when you wish to receive data without copying it with theOTRcvUData
function, theOTRcvURequest
function, theOTRcvUReply
function, theOTRcv
function, theOTRcvRequest
function, and theOTRcvReply
function.
You can only use this buffer for data; you cannot use it for the address or options that may be associated with the incoming data. For example, in the case of an incoming
- Note
- If you are familiar with STREAMS
mblk_t
data structures, you can see that the no-copy receive buffer structure is just a slight modification of themblk_t
structure.TUnitData
structure, you can only no-copy receive theudata
portion, not theaddr
oropt
fields.
The no-copy receive buffer structure is defined by the
- WARNING
- Under no circumstance write to this data structure. It is read-only. If you write to it, you can crash the system.
OTBuffer
data type.
struct OTBuffer { void* fLink; void* fLink2; OTBuffer* fNext; UInt8* fData; size_t fLen; void* fSave; UInt8 fBand; UInt8 fType; UInt8 fPad1; UInt8 fFlags; }; typedef struct OTBuffer OTBuffer;For more information, see "No-Copy Receiving".
Field Description
fLink
- Reserved.
fLink2
- Reserved.
fNext
- A pointer to the next
OTBuffer
structure in the linked chain. By tracing the chain offNext
pointers, you can access all of the data associated with the message.fData
- A pointer to the data portion of this
OTBuffer
structure.fLen
- The length of data pointed to by the
fData
field.fSave
- Reserved.
fBand
- The band used for the data transmission. It must be a value between 0 and 255.
fType
- The type of the data (normally
M_DATA
,M_PROTO
, orM_PCPROTO
).fPad1
- Reserved.
fFlags
- The flags associated with the data (
MSGMARK
,MSGDELIM
).
- IMPORTANT
- Once you have copied the data out of the no-copy receive buffer, you need to call the
OTReleaseBuffer
function as quickly as possible to return the buffer to Open Transport.