Re: Endpoint state - T_OUTCON
Re: Endpoint state - T_OUTCON
- Subject: Re: Endpoint state - T_OUTCON
- From: "Thomas E. Knowlton, Jr." <email@hidden>
- Date: Fri, 23 Jan 2004 14:56:03 -0700
>
Hello,
>
>
I have a couple of questions in respect of Open Transport.
>
>
1) Using Open Transport, if I call OTConnect in asynchronous mode, I
>
use my notifier function to be informed when this call succeeds or
>
fails.
>
But what if during my asynchronous waiting I have to destroy the
>
endpoint on which I have called OTConnect?
I think in this case, you should do OTSndDisconnect() before
OTCloseProvider(). I base this on my reading of Table 3-6 of the
Transport Provider Interface, v2, which shows that an outgoing
"discon_req1" is allowed while in state "TS_WCON_CREQ". Also, Table 4-4
of "Networking with OpenTransport" indicates that T_OUTCON is a valid
state before calling OTSndDisconnect.
>
I call OTGetEndpointState, and it returns T_OUTCON.
>
What actions should I perform to correctly shutdown this endpoint
>
without having to wait for this (possibly) lengthy operation to
>
complete?
>
>
2) If I issue OTConnect in asynchronous mode and then call
>
OTRemoveNotifier and OTSetSynchronous for the endpoint (because I have
>
to close down, for example), will it cause some error? Is this
>
approach incorrect in some way?
I have a similar situation in which I call OTSetSynchronous (I do this
in the destructor of an object that contains a TEndpoint, since I want
to reclaim all allocated resources by the time my destructor returns).
However, I chose to carefully write my notifier to use OTIsSynchronous
to decide whether some operations would be allowable before attempting
those ops. You will be especially interested in the comments on p. 71
of "Networking with OpenTransport". Further, I suspect that
OTRemoveNotifier while operations that were begun asynchronously have
not yet completed will result in delivery of notification (when the
operation completes) with undefined results. Like, I'm thinking you
crash, man.
HTH,
--Tk
>
>
Regards,
>
>
>
Igor
_______________________________________________
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.