Important: The information in this document is obsolete and should not be used for new development.
OTRcvConnect
Reads the status of an asynchronous call to theOTConnect
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 tonil
, 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 thecall->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 thecall->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 fieldcall->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 theOTRcvConnect
function to determine the status of a previously issuedOTConnect
call. If you want to retrieve information about the connection, you must allocate buffers for theaddr
field and, if required, theopt
andudata
fields before you make the call. You can examine theconnect
field of theTEndpointInfo
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 akOTNoError
result. If the connection is rejected, the function returns with akOTLookErr
result. In this case, you should call theOTLook
function to verify that aT_DISCONNECT
event is the reason for thekOTLookErr
, and then you should call theOTRcvDisconnect
function to clear the event.If the endpoint is asynchronous or nonblocking, the
OTRcvConnect
function returns with thekOTNoDataErr
result if the connection has not yet been established, or it returns the resultkOTNoError
and sets up the call structure appropriately.SPECIAL CONSIDERATIONS
Not all endpoints support the sending of data with a connection request. Examine theconnect
field of theTEndpointInfo
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
TheOTConnect
function.