OTRcvDisconnect
Identifies the cause of a connection break or of a connection rejection, acknowledges and clears the corresponding disconnection event.C INTERFACE
OSStatus OTRcvDisconnect(EndpointRef ref, TDiscon* discon);C++ INTERFACE
OSStatus TEndpoint::RcvDisconnect(TDiscon* discon);PARAMETERS
ref- The endpoint reference of the endpoint receiving the disconnection request.
discon- A pointer to a
TDisconstructure that specifies any user data,
a reason for the disconnection, and a connection request sequence number.DESCRIPTION
Calling theOTRcvDisconnectfunction clears the corresponding disconnection event and retrieves any user data sent with the disconnection.If you do not care about data returned with the disconnection and do not need to know the reason for the disconnection nor the sequence ID, you may specify a
nilpointer for thedisconparameter. In this case, the provider discards any user data associated with the disconnection.The
OTRcvDisconnectfunction behaves in the same way for all modes of operation. If there is no disconnection request pending, the function returns with thekOTNoDisconnectErrresult. If there is a disconnection request pending, the function returns either thekOTNoErrororkOTBufferOverflowErrresult. In the latter instance, you need to check thedisconfield of theTEndpointInfostructure for your endpoint and make sure that the buffer referenced by theudata.buffield is at least as big as the value specified for thedisconfield.VALID STATES
T_DATAXFER,T_OUTCON,T_OUTREL,T_INREL,T_INCON(when there is more than one pending disconnection request)SEE ALSO
To send an abortive disconnect, you call theOTSndDisconnectfunction (page 3-149).You use the
TDisconstructure (page 3-69) to specify that provides user data, a reason for the disconnection, and a connection request sequence number.For information on how to use this function with a TCP/IP protocol, see page 8-19 in the TCP/IP chapter.
For information on how to use this function with AppleTalk protocols, see page 13-12 in the ADSP chapter and page 15-11 in the PAP chapter.
For information on abortive and orderly disconnects, see "Terminating a Connection," beginning on page 3-30.
You examine the
disconfield of theTEndpointInfostructure (page 3-48) to find out whether your endpoint supports sending data with the disconnection request and to determine the maximum size of such data.