OTRcvRequest
You use theOTRcvRequestfunction to read a request from a connection-oriented transaction-based requester.C INTERFACE
OSStatus OTRcvRequest (EndpointRef ref, TRequest* req, OTFlags* reqFlags);C++ INTERFACE
OSStatus TEndpoint::RcvRequest(TRequest* req, OTFlags* flags);PPARAMETERS
ref- The endpoint reference of the endpoint reading the request.
req- A pointer to a
TRequeststructure (page 3-66) that contains information, on return, about the incoming request. See the description of theTRequeststructure for how to set this parameter when doing a no-copy receive.reqFlags- A bitmapped long specifying, on return, whether there is more request data coming (
T_MORE) and whether the provider is going to acknowledge replies (T_ACKNOWLEDGED).DESCRIPTION
You use theOTRcvRequestfunction to read an incoming request. After reading the request, you can use theOTSndReplyfunction to reply to that request or theOTCancelRequestfunction to reject the request.When the
OTRcvRequestfunction returns, thereq->data.buffield points to the request data and thereq->sequencefield specifies a transaction ID for this transaction. You must use this same sequence value when calling theOTSndReplyfunction to reply to this request or theOTCancelRequestfunction to reject it.If you have allocated a buffer that is too small to hold the request data, the provider sets the
T_MOREbit in thereqFlagsfield to indicate that there is more request data to be read. You must call theOTRcvRequestfunction until theT_MOREflag is cleared in order to retrieve the rest of the request data. Thereq->optfield contains returns no information for these additional calls.If the endpoint is in synchronous mode and is blocking, the
OTRcvRequestfunction returns only when a request arrives. If the endpoint is asynchronous or is not blocking, theOTRcvRequestfunction returns either the next unread request or thekOTNoDataErrresult if there are no pending requests.If flow-control restrictions prevent the provider from accepting the data when you call the
OTRcvRequestfunction, the function returns thekOTFlowErrresult. The provider issues theT_GODATAevent when flow-control restrictions are lifted.When a request arrives, the provider generates a
T_REQUESTevent. You can poll for this event using theOTLookfunction or call the function for as long as thekOTNoDataErrresult is returned. If you have a notifier installed for this endpoint, the event is sent to the notifier.VALID STATES
T_DATAXFER,T_OUTRELSEE ALSO
You use theOTSndReplyfunction (described next) to reply to a request that you have read using theOTRcvRequestfunction.You can use the
OTLookfunction to poll forT_REQUESTevents (page 3-85).
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help