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 Transactionless Endpoints /


OTRcvUDErr

Clears an error condition indicated by a T_UDERR event and returns the reason for the error.

C INTERFACE
OSStatus OTRcvUDErr(EndpointRef ref, 
                     TUDErr* uderr);
C++ INTERFACE
OSStatus TEndpoint::RcvUDErr(TUDErr* uderr);
PARAMETERS
ref
The endpoint reference of the endpoint that has attempted to send the data.

uderr
A pointer to a TUDErr structure that specifies, on return, the address of the endpoint to which data was sent, the options specified for the send, and the reason for the error.

The uderr->addr.buf field is a pointer to a buffer that contains the destination address of the data sent. You must allocate this buffer and set the uderr->addr.maxlen field to the maximum size for the buffer.

The uderr->opt.buf field is a pointer to a buffer that contains the value of options you specified for the send. You must allocate a buffer for this data and set the uderr->opt.maxlen field to the maximum size of the buffer.

The uderr->error field is a 32-bit value that specifies a protocol-dependent error code for the OTSndUData function that failed.

function result
An error code. See Discussion.
DISCUSSION
You use the OTRcvUDErr function if you have called the OTSndUData function and the endpoint provider has issued the T_UDERR event to indicate that the send operation did not succeed. This usually happens when you have specified a bad address or option value. For example, assume that you are using AppleTalk and you specify an NBP address. If Open Transport cannot resolve the address, it sends a T_UDERR event to your notifier function. To clear the error condition and determine the cause of the failure, you must call the OTRcvUDErr function.

If the size of the option or error data returned exceeds the size of the allocated buffers, the OTRcvUDErr function returns with the result kOTBufferOverflowErr, but the error indication is cleared anyway.

If you do not need to identify the cause of the failure, you can set the uderr pointer to NULL. In this case, the OTRcvUDErr function clears the error indication without reporting any information to you. It is important, nevertheless, that you actually call the OTRcvUDErr function to clear the error condition. If you don't call this function, the endpoint remains in an invalid state for doing other send operations, and all subsequent functions for this endpoint return the result kOTLookErr.

SEE ALSO
Table 4-4.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998