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 theOTConnectfunction.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
TCallstructure 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.buffield points to a buffer that specifies the address to which you are actually connected. Set thecall->addr.maxlenfield to the size of the address.
- The
call->opt.buffield points to a buffer that contains the option values that were negotiated for this connection. Set thecall->opt.maxlenfield to the size of the buffer.
- The
call->udata.buffield points to a buffer that contains any data sent as part of the conection request. Set the fieldcall->udata.maxlento the size of the buffer.
- The
call->sequencefield is not used by this function.
- function result
- An error code. See Discussion.
DISCUSSION
You call theOTRcvConnectfunction to determine the status of a previously issuedOTConnectcall. If you want to retrieve information about the connection, you must allocate buffers for theaddrfield and, if required, theoptandudatafields before you make the call. You can examine theconnectfield of theTEndpointInfostructure to determine whether your endpoint supports the receiving of data with a connection request.If the endpoint is synchronous and blocking, the
OTRcvConnectfunction waits for the connection to be accepted or rejected. If the connection is accepted, the function returns with akOTNoErrorresult. If the connection is rejected, the function returns with akOTLookErrresult. In this case, you should call theOTLookfunction to verify that aT_DISCONNECTevent is the reason for thekOTLookErr, and then you should call theOTRcvDisconnectfunction to clear the event.If the endpoint is asynchronous or nonblocking, the
OTRcvConnectfunction returns with thekOTNoDataErrresult if the connection has not yet been established, or it returns the resultkOTNoErrorand sets up the call structure appropriately.SPECIAL CONSIDERATIONS
Not all endpoints support the sending of data with a connection request. Examine theconnectfield of theTEndpointInfostructure for the endpoint to determine if the endpoint supports the sending of data and to determine the maximum size of the data.SEE ALSO
TheOTConnectfunction.