Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 22 - Endpoints Reference / Functions
Functions for Connectionless Transaction-Based Endpoints /


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 the reply->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 the reply->addr.buf field to point to the buffer and set the reply->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 the reply->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 the reply->udata.buf field to point to that buffer, and set the reply-> udata.len field to specify the size of the reply. The size cannot exceed the value specified for the tsdu field of the TEndpointInfo structure for the endpoint.

Set the reply->sequence field to the value that you read for this field with the OTRcvURequest 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 the OTSndUReply function.

function result
An error code. See Discussion.
DISCUSSION
You use the OTSndUReply function to send a reply. The TUnitReply structure that you pass in the reply 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 the sequence field of the reply 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 the kETIMEDOUTErr 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 the reqFlags field of the req parameter for the OTRcvURequest function. If the T_ACKNOWLEDGED flag is set, then the T_REPLYCOMPLETE event indicates that your reply was received. The cookie parameter passed to the notifier to indicate completion is set to the reply parameter.

The following table shows how the endpoint's mode of execution and blocking status affects the behavior of the OTSndUReply function.

 BlockingNonblocking
SynchronousThe 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 the code parameter when the reply is acknowledged or timed out.

The function returns immediately.

The provider calls your notifier, passing T_REPLYCOMPLETE for the code parameter when the reply is acknowledged or timed out.

 The kOTFlowErr result might be returned.The kOTFlowErr result might be returned.

SEE ALSO
The OTCancelUReply function.

"AppleTalk Reference".

Table 4-4.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998