OTSndUReply
Replies to a request sent by a client using a connectionless transaction-
based protocol.C INTERFACE
OSStatus OTSndUReply (EndpointRef ref, TUnitReply* reply, OTFlags flags);C++ INTERFACE
OSStatus TEndpoint::SndUReply(TUnitReply* reply, OTFlags flags);PARAMETERS
ref- The endpoint reference of the endpoint sending the reply.
reply- A pointer to a
TUnitReplystructure (page 3-60) that specifies the ID of this transaction and the reply data.reqFlags- A bitmapped long, which you can set to
T_MOREto indicate that you are sending more reply data with a subsequent call to theOTSndUReplyfunction.DESCRIPTION
You use theOTSndUReplyfunction to send a reply. TheTUnitReplystructure that you pass in thereplyparameter specifies the address of the requester, the reply data, and any options you want to specify for this reply. If you do not specify the requester's address, the endpoint provider uses the transaction ID value stored in thesequencefield of thereplyparameter to match the reply against a pending request and knows in this way where to send the request.If requests are acknowledged and the provider is not able to send the reply, the function returns with the
kETimedOutErrresult. If requests are not acknowledged, the function returns immediately, and you have no way of knowing whether the reply was received and read.If requests are not acknowledged, the provider generates a
T_REPLYCOMPLETEevent for asynchronous responders even if the requester has not acknowledged receipt of the reply. Thus, the only way for you to know whether this event actually means that the reply was received, is to examine thereqFlagsfield of thereqparameter for theOTRcvURequestfunction. If theT_ACKNOWLEDGEDflag is set, then theT_REPLYCOMPLETEevent indicates that your reply was received. Thecookieparameter passed to the notifier to indicate completion is set to thereplyparameter.The following table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndUReplyfunction.
Blocking Nonblocking Synchronous The function returns when the provider lifts flow-control restrictions and the reply has been acknowledged or timed out (if the matching request was an acknowledged request). For unacknowledged requests, the function
returns immediately; for acknowledged requests,
it returns when the reply
has been acknowledged
or time out.The kOTFlowErrresult is never returned.The kOTFlowErrresult might be returned.Asynchronous The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETEfor thecodeparameter when the reply is acknow-
ledged or timed out.The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETEfor thecodeparameter when the reply is acknowledged or timed out.The kOTFlowErrresult is never returned.The kOTFlowErrresult might be returned.COMPLETION EVENT CODES
T_REPLYCOMPLETE0x20000004 The OTSndUReplyfunction has completed. Thecookieparameter of the notifier function points to thereplyparameter.VALID STATES
T_IDLESEE ALSO
To determine the maximum size of the reply data, you must call theOTGetEndpointInfofunction (page 3-82) and examine thetsdufield of theTEndpointInfostructure that it returns.You use the
TUnitReplystructure (page 3-60) to specify the ID of this transaction and the reply data.You use the
OTDatastructure (page 3-52) to describe noncontiguous data.You use the
OTCancelUReplyfunction (page 3-119) to cancel an incoming request.For information on how to use this function with the AppleTalk ATP protocol, see page 14-10 in the ATP chapter.
You examine the
reqFlagsfield of thereqparameter for theOTRcvURequestfunction (page 3-110) to determine whether theT_REPLYCOMPLETEevent means that the reply was actually received.