Important: The information in this document is obsolete and should not be used for new development.
OTSndRequest
Sends a request to a connection-oriented transaction-based endpoint.C INTERFACE
OSStatus OTSndRequest(EndpointRef ref, TRequest* req, OTFlags reqFlags);C++ INTERFACE
OSStatus TEndpoint::SndRequest(TRequest* req, OTFlags reqFlags);PARAMETERS
ref- The endpoint reference of the endpoint making the request.
req- A pointer to a
TRequeststructure that contains information about the request, options for this request, and the transaction ID of the request. You must allocate buffers for this information and specify their size.
- The
req->data.buffield is apointer to a buffer that contains the request. Set thereq->data.lenfield to the size of the request data. The size of the request cannot exceed the value specified for theetsdufield of theTEndpointInfostructure for the endpoint.
- The
req->opt.buffield is a pointer to a buffer that contains option values you want to negotiate for this request. Set thereq->opt.lenfield to the size of the option data. Set theopt.lenfield to 0 if there are no options.
- The
req->sequencefield specifies a unique non-zero number of your choice that identifies this request.
reqFlags- A bitmapped 32-bit value specifying whether you are sending request data using additional calls to this function (
T_MORE) and whether you plan to acknowledge replies (T_ACKNOWLEGED). Use the bitwiseORoperator to set both bits.
- function result
- An error code. See Appendix B, and Discussion.
DISCUSSION
You use theOTSndRequestfunction to initiate a transaction for a connection-oriented transaction-based endpoint. Call theOTRcvReplyfunction to read the reply to your request.By default, delivery is guaranteed for you, but not for the responder. That is, you will always find out whether your request was received, but the responder only receives acknowledgment that you received the reply if you set the
T_ACKNOWLEDGEDbit in thereqFlagsparameter when you send the request.If the responder is an Open Transport endpoint, its provider generates a
T_REPLYCOMPLETEevent when you have read the reply. This happens whether or not theT_ACKNOWLEDGEDbit is set; but if it is set, this guarantees that the reply was delivered. If you don't set this flag, the responder's call to theOTSndReplyfunction returns right away, and the responding endpoint receives no additional information as to whether the reply was received and the data was read.Setting the
T_MOREbit tells the endpoint provider that you are using several calls to theOTSndRequestfunction to send the request data. Note that even though you are using several calls, the request data, put all together, must still not exceed the value specified for theetsdufield in the endpoint'sTEndpointInfostructure.If the endpoint is in synchronous blocking mode and flow-control restrictions prevent the endpoint provider from accepting the
OTSndRequestfunction, Open Transport retries the operation until flow-control restrictions are lifted.If the endpoint is in asynchronous or nonblocking mode and flow-control restrictions prevent the endpoint provider from accepting the
OTSndRequestfunction, Open Transport returns thekOTFlowErrresult. When flow-control restrictions are lifted, the provider issues aT_GODATAevent, which you can retrieve using your notifier function or by polling the endpoint using theOTLookfunction. When you get this event, you can try sending the request again.The next table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndRequestfunction.
Blocking Nonblocking Synchronous The function returns when the provider lifts flow-control restrictions and the request has been sent to the protocol. The function returns if flow-control restrictions are in effect or the request data has been sent to the protocol. The kOTFlowErrresult is never returned.The kOTFlowErrresult might be returned.Asynchronous The function returns immediately. The function returns immediately. The kOTFlowErrresult might be returned.The kOTFlowErrresult might be returned.SEE ALSO
"AppleTalk Reference".