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
TCallstructure 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->addrfield and thecall->optfield are reserved and should be set to 0.
- The
call->udata.buffield is a pointer to a buffer containing data that you want to send with the disconnection request. Set thecall->udata.lenfield to the size of the data. The amount of data should not exceed the limits supported by the endpoint, as returned in thedisconfield of theTEndpointInfostructure.
- The
call->sequencefield 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 theOTSndDisconnectfunction to tear down a connection or to reject incoming connection requests. Whenever possible, use the functionOTSndOrderlyDisconnectto 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
OTSndDisconnectfunction returns immediately with a result ofkOTNoErrorto indicate that the disconnection process has begun and that your notifier function will be sent aT_DISCONNECTCOMPLETEevent when the process completes. Thecookieparameter contains thecallparameter.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
MyNotifierCallbackfunction and "Event Codes".
SEE ALSO
"TCP/IP Services".