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
Tearing Down a Connection /


OTSndDisconnect

Tears down an open connection (abortive disconnect) or rejects an incoming connection request.

C INTERFACE
OSStatus OTSndDisconnect(EndpointRef ref,
                     TCall* call);
C++ INTERFACE
OSStatus TEndpoint::SndDisconnect(TCall* call);
PARAMETERS
ref
The endpoint reference for the endpoint tearing down the connection or rejecting the connection request.

call
A pointer to a TCall structure that specifies the connection to be torn down or rejected, and specifies data sent with the disconnection request if the endpoint supports sending such data.

The call->addr field and the call->opt field are reserved and should be set to 0.

The call->udata.buf field is a pointer to a buffer containing data that you want to send with the disconnection request. Set the call->udata.len field to the size of the data. The amount of data should not exceed the limits supported by the endpoint, as returned in the discon field of the TEndpointInfo structure.

The call->sequence field should be set to a valid value to identify the request if you are using this function to reject a connection request. This field is ignored if you are using this function to tear down a connection.

function result
An error code. See Appendix B.
DISCUSSION
You can use the OTSndDisconnect function to tear down a connection or to reject incoming connection requests. Whenever possible, use the function OTSndOrderlyDisconnect to tear down a connection.

If the endpoint is in synchronous mode, the function returns when the operation is complete. If the endpoint is in asynchronous mode, the OTSndDisconnect function returns immediately with a result of kOTNoError to indicate that the disconnection process has begun and that your notifier function will be sent a T_DISCONNECTCOMPLETE event when the process completes. The cookie parameter contains the call parameter.

If you have not installed a notifier function, you cannot determine when this function completes. For more information on notifier functions and event codes, see MyNotifierCallback function and "Event Codes".

SEE ALSO
"TCP/IP Services".

"AppleTalk Reference".

"Terminating a Connection".

Table 4-4.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998