Re: notifier cookie values for T_ACCEPTCOMPLETE and T_PASSCON?
Re: notifier cookie values for T_ACCEPTCOMPLETE and T_PASSCON?
- Subject: Re: notifier cookie values for T_ACCEPTCOMPLETE and T_PASSCON?
- From: "Thomas E. Knowlton, Jr." <email@hidden>
- Date: Tue, 20 Jan 2004 13:43:25 -0700
Ok, I've learned more. It appears that the cookies passed back to these
asynchronous events are at a different level of indirection than what's
normally passed around: when I look at the data pointed at by the
EndpointRef that I got from the cookie of T_OPENCOMPLETE, I see the
same value that I eventually get in the cookie of T_ACCEPTCOMPLETE.
For the brave and interested, I'm including some MacsBug log at the
bottom, which shows what I'm talking about. For anyone who might do
something to fix OpenTransport (I'm guessing this will be nobody, since
I've only witnessed this bug on "Classic" and Mac OS 9), I hope my
DebugStr's have an appropriate level of detail.
My workaround will be to compare the cookies with the void* at the
address pointed to by my EndpointRef. For the record, it's not useful
in the way I had hoped to use it: T_ACCEPTCOMPLETE gets sent to the
listener's notifier with the listener's data in its cookie. I had hoped
to use the cookie to see which acceptor endpoint had completed
accepting.
I hope this will be useful or at least interesting to OT programmers on
this list...
--
Tommy Knowlton
On Jan 20, 2004, at 10:56 AM, Thomas E. Knowlton, Jr. wrote:
The PDF (Networking with OpenTransport) indicates that
T_ACCEPTCOMPLETE and T_PASSCON events arriving on the notifier will
have cookie values equal to the accepting endpoint reference.
(Actually that document is internally inconsistent - on p. 492 it
states that T_ACCEPTCOMPLETE gets the "res" or listening endpoint ref,
and on p. 386 it states that it's the "resRef" or accepting endpoint
reference).
In my app, both statements appear to be wrong. The cookies I'm getting
back for those events appear to be altogether unrelated to the ep refs
of the listener _or_ the acceptor. That is, when I do OTAccept(AAA,
BBB, call) I see T_ACCEPTCOMPLETE's cookie is neither AAA nor BBB and
likewise with T_PASSCON.
Has anyone on this list noticed this behavior, or do any of you have
any idea what I may be doing wrong to provoke this behavior? My design
does not depend on the documented behavior, but I had thought to use
it in development as a sanity check, and it turns out my code is
insane if the cookies are to be believed.
For context, I'm developing an OpenTransport classic application for
Mac OS 9, not using Carbon.
Thanks in advance.
--
Tommy Knowlton
... opened and bound a lstnr and opened some acptr endpoints unbound,
and then:
Entering pListenerNotify(context=0x0a376cf8, code=0x00000001,
result=0x00000000, cookie=0x0a
385f54)
User break at 3E3354D4 CSessionController::On_T_LISTEN()+00044
Entering On_T_LISTEN with this=0x0a376cf8
User break at 3E335638 CSessionController::On_T_LISTEN()+001A8
Allocated a TCall at 0x0a386188.
User break at 3E335690 CSessionController::On_T_LISTEN()+00200
Got back from Listen on ep 0x0a385f54.
User break at 3E3361B8 CSession::HandoffFrom(TEndpoint*, TCall*)+00048
Entering HandoffFrom with this=0x0a374f98
User break at 3E3361E4 CSession::HandoffFrom(TEndpoint*, TCall*)+00074
lstnr = 0x0a385f54, caller = 0x0a386188
User break at 3E335BC8 CSessionController::pListenerNotify(void*,
unsigned long, long, void*)
+00078
Entering pListenerNotify(context=0x0a376cf8, code=0x20000003,
result=0x00000000, cookie=0x00
329aac)
User break at 3E335260
CSessionController::On_T_ACCEPTCOMPLETE(TEndpoint*)+00040
Entering On_T_ACCEPTCOMPLETE with this=0x0a376cf8
User break at 3E33528C
CSessionController::On_T_ACCEPTCOMPLETE(TEndpoint*)+0006C
resRef ep is 0x00329aac
User break at 3E3368E8 CSession::pAcceptorNotify(void*, unsigned long,
long, void*)+00078
Entering pAcceptorNotify(context=0x0a374f98, code=0x00001000,
result=0x00000000, cookie=0x00
32975c)
User break at 3E3367C0 CSession::On_T_PASSCON(TEndpoint*)+00040
Entering On_T_PASSCON with this=0x0a374f98
User break at 3E3367F0 CSession::On_T_PASSCON(TEndpoint*)+00070
ref ep is 0x0032975c (mAcptr is 0x0a385f44)
NMI
Displaying long
0A385F44 0032975C
Displaying long
0A385F54 00329AAC
_______________________________________________
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.