The TReply Structure
You use theTReplystructure to specify the data being sent with theOTSndReplyfunction (page 3-141) and the data being read with theOTRcvReplyfunction (page 3-144). You pass this structure as a parameter to each of these functions.The
TReplystructure is defined by theTReplydata type.
struct TReply { TNetbuf data; TNetbuf opt; OTSequence sequence; }; typedef struct TReply TReply;
Field Description
data- A
TNetbufstructure specifying the location and size of the reply buffer.- In the
replyparameter to theOTSndReply function, this field specifies the location and size of a buffer containing the reply data. You must allocate and initialize a buffer that contains the data and set thedata.buffield to point to it. You must set thedata.lenfield to the size of the reply data. The size of the reply must not exceed the value specified for thetsdufield of theTEndpointInfostructure for this endpoint.- In the
replyparameter to theOTRcvReplyfunction, on return, this field specifies the size and location of a buffer into which the function places the data to be read. You must allocate a buffer for this data, set thedata.buffield to point to it, and set thedata.maxlenfield to the maximum size of the buffer. This value must not exceed the value specified for thetsdufield of theTEndpointInfostructure for this endpoint.- If you are doing a no-copy receive, the
data.buffield is a pointer to anOTBufferpointer. In this case, you must set thedata.maxlenfield to the constantkNetbufDataIsOTBufferStar.opt- A
TNetbufstructure describing the size and location of an option buffer.- In the
replyparameter to theOTSndReply function, this field specifies the location and size of a buffer containing the options you want to set. You must allocate a buffer for the option values, set theopt.buffield to point to it, and set theopt.lenfield to the length of the options or to 0 if don't want to specify any options.- In the
replyparameter to theOTRcvReply function, on return, this field specifies the location and size of a buffer containing the association-related options sent with theOTSndReplyfunction. You must allocate a buffer for the option information, set theopt.buffield to point to it, and set theopt.maxlenfield to the maximum size of the buffer.sequence- A long that specifies the transaction ID of the current transaction.
- When sending a reply, you set this field to the value that you read with the
OTRcvURequestfunction for this field.- When receiving a reply, if you have sent out multiple requests, you use this field to match incoming replies to outgoing requests.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help