Important: The information in this document is obsolete and should not be used for new development.
OTListen
Listens for an incoming connection request.C INTERFACE
OSStatus OTListen(EndpointRef ref, TCall* call);C++ INTERFACE
OSStatus TEndpoint::Listen(TCall* call);PARAMETERS
ref- The endpoint reference of the endpoint listening for the connection request.
call- A pointer to a
TCallstructure that contains, on return, information about the address of the peer requesting the connection, option information, data associated with the connection request, and the connection ID for this connection. You must allocate buffers in which this information can be stored and specify the maximum length for each buffer.
- The
call->addr.buffield points to a buffer that will hold the address of the endpoint that requested the connection. Set thecall->addr.maxlenfield to the size of the buffer.
- The
call->opt.buffield points to a buffer that will hold the options that the peer has requested for this connection. Set thecall->opt.maxlenfield to the size of the buffer.
- The
call->udata.buffield points to a buffer that stores any data sent by the endpoint requesting the connection. Set thecall->udata.maxlenfield to the maximum size of this buffer.
- The
call->sequencefield contains the connection ID of the incoming request.
- function result
- An error code. See Discussion.
DISCUSSION
You use theOTListenfunction to listen for incoming connection requests.If the endpoint is in synchronous mode and is blocking, the
OTListenfunction returns when a connection request has arrived. On return, the function fills in theTCallstructure referenced by thecallparameter with information about the connection request. After retrieving the connection request using theOTListenfunction, you can reject the request using theOTSndDisconnectfunction, or you can accept the request using theOTAcceptfunction.If the endpoint is in asynchronous mode or is not blocking, the
OTListenfunction returns any pending connection requests or returns thekOTNoDataErrresult if there are no pending connection requests. Typically, you would call theOTListenfunction from within a notifier function in response to theT_LISTENevent..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
"AppleTalk Reference".