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
Establishing Connection /


OTRcvConnect

Reads the status of an asynchronous call to the OTConnect function.

C INTERFACE
OSStatus OTRcvConnect(EndpointRef ref,
                     TCall* call);
C++ INTERFACE
OSStatus TEndpoint::RcvConnect(TCall* call);
PARAMETERS
ref
The endpoint reference of the endpoint initiating the connection.

call
A pointer to a TCall structure that, on return, contains information about the newly established connection. You can set this parameter to nil, in which case no information is returned to you. Otherwise, you must allocate buffers for the address, option, and data returned, and you must specify the maximum length for each buffer.

The call->addr.buf field points to a buffer that specifies the address to which you are actually connected. Set the call->addr.maxlen field to the size of the address.

The call->opt.buf field points to a buffer that contains the option values that were negotiated for this connection. Set the call->opt.maxlen field to the size of the buffer.

The call->udata.buf field points to a buffer that contains any data sent as part of the conection request. Set the field call->udata.maxlen to the size of the buffer.

The call->sequence field is not used by this function.

function result
An error code. See Discussion.
DISCUSSION
You call the OTRcvConnect function to determine the status of a previously issued OTConnect call. If you want to retrieve information about the connection, you must allocate buffers for the addr field and, if required, the opt and udata fields before you make the call. You can examine the connect field of the TEndpointInfo structure to determine whether your endpoint supports the receiving of data with a connection request.

If the endpoint is synchronous and blocking, the OTRcvConnect function waits for the connection to be accepted or rejected. If the connection is accepted, the function returns with a kOTNoError result. If the connection is rejected, the function returns with a kOTLookErr result. In this case, you should call the OTLook function to verify that a T_DISCONNECT event is the reason for the kOTLookErr, and then you should call the OTRcvDisconnect function to clear the event.

If the endpoint is asynchronous or nonblocking, the OTRcvConnect function returns with the kOTNoDataErr result if the connection has not yet been established, or it returns the result kOTNoError and sets up the call structure appropriately.

SPECIAL CONSIDERATIONS
Not all endpoints support the sending of data with a connection request. Examine the connect field of the TEndpointInfo structure for the endpoint to determine if the endpoint supports the sending of data and to determine the maximum size of the data.

SEE ALSO
The OTConnect function.

"AppleTalk Reference".

Table 4-4.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998