Important: The information in this document is obsolete and should not be used for new development.
OTSndUReply
Replies to a request sent by a client using a connectionless transaction-based protocol.C INTERFACE
OSStatus OTSndUReply(EndpointRef ref, TUnitReply* reply, OTFlags replyFlags);C++ INTERFACE
OSStatus TEndpoint::SndUReply(TUnitReply* reply, OTFlags replyFlags);PARAMETERS
ref
- The endpoint reference of the endpoint sending the reply.
reply
- A pointer to a
TUnitReply
structure that specifies information about the requester, options, the ID of this transaction, and the reply data.
- The
reply->addr
field specifies the location and size of a buffer containing the address of the requester. You are not required to provide this information. If you do not want to provide address information, set thereply->addr.len
field to 0. To specify an address, you must allocate a buffer for the address and initialize it to the destination address. Then you set thereply->addr.buf
field to point to the buffer and set thereply->addr.len
field to the length of the address.
- The
reply->opt
field specifies the location and size of a buffer containing the options that you set for this reply. You must set thereply->opt.len
field to the length of the options or to 0 if you don't want to specify any options.
- The
reply->udata
field specifies the location and size of a buffer containing the reply data sent to the requester. You allocate a buffer that contains the reply data, set thereply->udata.buf
field to point to that buffer, and set thereply-> udata.len
field to specify the size of the reply. The size cannot exceed the value specified for thetsdu
field of theTEndpointInfo
structure for the endpoint.
- Set the
reply->sequence
field to the value that you read for this field with theOTRcvURequest
function.
replyFlags
- A bitmapped 32-bit value, which you can set to
T_MORE
to indicate that you are sending more reply data with a subsequent call to theOTSndUReply
function.
- function result
- An error code. See Discussion.
DISCUSSION
You use theOTSndUReply
function to send a reply. TheTUnitReply
structure that you pass in thereply
parameter specifies the address of the requester, the reply data, any options you want to specify for this reply, and a transaction ID. If you do not specify the requester's address, the endpoint provider uses the transaction ID value stored in thesequence
field of thereply
parameter to match the reply against a pending request and knows in this way where to send the request.If requests are acknowledged and you do not receive an acknowledgement from the other side within a specific amount of time (usually negotiated with the
ATP_OPT_RELTIMER
option), the function returns with thekETIMEDOUTErr
result. 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_REPLYCOMPLETE
event code 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 thereqFlags
field of thereq
parameter for theOTRcvURequest
function. If theT_ACKNOWLEDGED
flag is set, then theT_REPLYCOMPLETE
event indicates that your reply was received. Thecookie
parameter passed to the notifier to indicate completion is set to thereply
parameter.
The following table shows how the endpoint's mode of execution and blocking status affects the behavior of the
OTSndUReply
function.
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). The function returns immediately. The kOTFlowErr
result is never returned.The kOTFlowErr
result might be returned.Asynchronous The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETE
for thecode
parameter when the reply is acknowledged or timed out.The function returns immediately. The provider calls your notifier, passing
T_REPLYCOMPLETE
for thecode
parameter when the reply is acknowledged or timed out.The kOTFlowErr
result might be returned.The kOTFlowErr
result might be returned.SEE ALSO
TheOTCancelUReply
function.