Re: Open Transport -3168 (state changing)
Re: Open Transport -3168 (state changing)
- Subject: Re: Open Transport -3168 (state changing)
- From: Bob Cook <email@hidden>
- Date: Thu, 21 Nov 2002 21:06:31 -0800
Hi,
I recently ran into a similar problem when I tried to cancel
outstanding asynchronous ::OTConnect() function calls on Mac OS X.
My code creates endpoints in sync mode, then switch to use asynchronous
blocking plus a notifier, followed by a call to ::OTConnect(). After
some period of time, I attempt to cancel the pending connection with
::OTSndDisconnect(). This works exactly as expected on OS 9.
Unfortunately under OS X I find the endpoint goes from T_OUTCON into
T_IDLE, but calling ::OTUnbind() consistently returns
kOTStateChangeErr. It never recovers into T_UNBND. In my case
::OTLook() always returns 0. This behavior was 100% consistent.
My solution is to call ::OTCloseProvider() instead of ::OTUnbind() on
Mac OS X. Under OS 9 I continue to use ::OTUnbind() followed by
::OTCloseProvider() since it seems to work reliably.
Two questions:
(1) Is this strategy going to cause me problems in other places? How
sensitive is the OT shim on OS X to these sorts of behaviors? My past
experience with OT has been that its best to "follow the rules" but
that seems unlikely to be possible in this case. Am I doomed? Or will
it all work out ok?
(2) Am I the only one seeing this behavior? I guess its worth asking
since my perusal of the archives only discusses canceling synchronous
calls to ::OTConnect() [where my experience is with async mode]. I was
able to reproduce this on 10.1.5, 10.2, and 10.2.2. I don't have other
versions readily available to test with, but my feeling is that this is
not new.
Thanks,
Bob Cook
On Thursday, November 21, 2002, at 12:21 PM, Rich Kubota wrote:
An OTLook result of 4 is a T_DATA event has occurred on the endpoint.
OTLook returns event codes, in contrast to error codes. Normally it
returns T_DISCONNECT, etc.
The result of 4 doesn't make sense since you have reported the state
to be T_IDLE. In a previous response on a question regarding
OTGetProtAddress returning the kOTStateChangeErr, Quinn indicated that
the possibility of a bug in the OT Framework - where possibly and
endpoint lock was left set.
Since the endpoint is not in use, how about calling OTCloseProvider on
the endpoint and reopening the endpoint during task level time.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.