ADC Home > Reference Library > Technical Q&As > Networking > Carbon >

Not Recommended Documentclose button

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:

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 T_IDLE to T_OUTCON. Calling SndDisconnect returns the endpoint state to T_IDLE. You may be getting a kOTOutStateErr for the following reasons:

  1. The original OTConnect failed. Determine this by checking the OTConnect result.
  2. 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 the disconnect.

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]

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.