ADC Home > Reference Library > Technical Q&As > Networking > Carbon >
Not Recommended Document
Important: The information in this document is Not Recommended and should not be used for new development.
Current information on this Reference Library topic can be found here:
Technical Q&A NW29
Aborting a OTConnect in Progress
Q: I'd like my network client software to be able to abort an asynchronous
OTConnect in progress -- to allow a user, for example, to recover from an
attempted connection to a nonexistent IP address.
I've been calling
OTSndDisconnect to abort it, but when I check the return
code, I get a
kOTOutStateErr. What gives?
A: Using a
OTSndDisconnect is the proper way to abort an
OTConnect in progress.
After successfully calling
OTConnect, the endpoint state will transition from
SndDisconnect returns the endpoint state to
T_IDLE. You may be getting a
kOTOutStateErr for the following reasons:
- The original
OTConnect failed. Determine this by checking the
- The connection broke and was asynchronously handled by your notifier. In
this case, your endpoint would no longer be in the
T_OUTCON state when you do
A good rule of thumb is to always confirm the endpoint state before doing the
OTSndDisconnect to insure that the endpoint isn't already disconnected.
[May 14 1996]