OTSndURequest
Initiates a connectionless transaction by sending a request to the responder.C INTERFACE
OSStatus OTSndURequest (EndpointRef ref, TUnitRequest* req, int reqFlags);C++ INTERFACE
OSStatus TEndpoint::SndURequest(TUnitRequest* req, int reqFlags);PARAMETERS
ref- The endpoint reference of the endpoint making the request.
req- A pointer to a
TUnitRequeststructure (page 3-58) that specifies the address of the responder, the request data, and the ID of this transaction.reqFlags- A bitmapped long specifying whether delivery is guaranteed for both the requester and the responder (
T_ACKNOWLEDGED) and whether you are sending the request data using additional calls to theOTSndURequestfunction (T_MORE). Use thebitANDoperator to set both values.DESCRIPTION
You use theOTSndURequestfunction to initiate a transaction. When the responder replies to your request, you use theOTRcvUReplyfunction to read the reply. By default, the endpoint provider guarantees delivery 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 have set theT_ACKNOWLEDGEDflag in thereqFlagsparameter when you send the request. Not all protocols honor this flag.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_ACKNOWLEDGEDflag 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 theOTSndUReplyfunction 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_MOREflag tells the endpoint provider that you are using several calls to theOTSndURequestfunction to send the request data. Note that even though you are using several calls, the request data, all put together, must still not exceed the value specified for theetsdufield in the endpoint'sTEndpointInfostructure.If the endpoint is in blocking mode and flow-control restrictions prevent the endpoint provider from accepting the
OTSndURequestfunction, the provider waits to send the request until flow-control restrictions are lifted.If the endpoint is in nonblocking mode and flow-control restrictions prevent the endpoint provider from accepting the
OTSndURequestfunction, the function returns thekOTFLowErrresult. When flow-control restrictions are lifted, the endpoint provider issues aT_GODATAevent, which you can retrieve by polling the endpoint using theOTLookfunction or using a notifier function. When you get this event, you can retry sending the request.The following table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndURequestfunction.
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 is never returned.The kOTFlowErrresult might be returned.VALID STATES
T_IDLESEE ALSO
To determine the maximum size of the request data, you must call theOTGetEndpointInfofunction (page 3-82) and examine theetsdufield of theTEndpointInfostructure that it returns.You use the
TUnitRequeststructure (page 3-58) to specify the address of the responder, the request data, and the ID of this transaction.You use the
OTDatastructure (page 3-52) to transfer noncontiguous data.To read the reply to an outgoing request, you must use the
OTRcvUReplyfunction (page 3-115).For information on how to use this function with the AppleTalk ATP protocol, see page 14-9 in the ATP chapter.
You can poll for the
T_GODATAevent by calling theOTLookfunction (page 3-85).