OTSndReply
You use theOTSndReplyfunction to reply to a connection-oriented transaction-
based request.C INTERFACE
OSStatus OTSndReply (EndpointRef ref, TReply* reply, OTFlags* replyFlags);C++ INTERFACE
OSStatus TEndpoint::SndReply(TReply* reply, OTFlags flags);PARAMETERS
ref- The endpoint reference of the endpoint reading the request.
reply- A pointer to a
TReplystructure (page 3-67) that specifies the reply data being sent, the transaction ID for this transaction, and any options you want to set.replyFlags- A bitmapped long specifying whether the rest of the reply is being sent with a subsequent call to this function (
T_MORE) or whether this is the complete reply (T_MOREnot set).DESCRIPTION
You use theOTSndReplyfunction to reply to a request you have read using theOTRcvRequestfunction. Thereplyparameter contains the reply to be sent, and thereplyFlagsparameter specifies whether you are sending the entire reply with this send (T_MOREbit clear) or sending just part of the reply (T_MOREbit set). If you are using multiple sends to send the reply, you must set theT_MOREbit on each but the last send. The total size of the data you send using multiple sends must not exceed the value of thetsdufield of theTEndpointInfostructure for this endpoint.If the endpoint is in blocking mode, the
OTSndReplyfunction returns after it has sent the reply. If the endpoint is in nonblocking mode, theOTSndReplyfunction returns thekOTFlowErrresult if the endpoint provider is unable to send the reply because of flow-control restrictions. The provider issues theT_GODATAevent when these restrictions are lifted. You can use theOTLookfunction to poll for this event, or you can use your notifier to handle it.If the endpoint is in asynchronous mode, the provider calls your notifier when the
OTSndReplyfunction completes. Thecodeparameter of the notifier function contains theT_REPLYCOMPLETEevent, thecookieparameter contains thereplyparameter passed with theOTSndReplyfunction, and theresultparameter contains the function result.The next table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndReplyfunction.
Blocking Nonblocking Synchronous The function returns when the provider lifts flow-control restrictions and the reply has been successfully sent or timed out. The function returns if flow-
control restrictions are in effect or when the reply has been successfully sent or timed 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 successfully sent or timed out.The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETEfor thecodeparameter when the reply is successfully sent or timed out.The kOTFlowErrresult is never returned.The kOTFlowErrresult might be returned.VALID STATES
T_DATAXFER,T_OUTRELCOMPLETION EVENTS
T_REPLYCOMPLETE0x20000004 The OTSndReplyfunction has completed. Thecookieparameter of the notifier function points to thereplyparameter.SEE ALSO
You use theOTRcvRequestfunction (page 3-139) to read an incoming request before calling theOTSndReplyfunction to reply to the request.You use the
TReplystructure (page 3-67) to specify the reply data being sent, the transaction ID for this transaction, and any options you want to set.The peer endpoint calls the
OTRcvReplyfunction (page 3-144) to acknowledge receiving the reply you send using theOTSndReplyfunction.You use the
OTDatastructure (page 3-52) to transfer noncontiguous data.