Re: T_MEMORYRELEASED
Re: T_MEMORYRELEASED
- Subject: Re: T_MEMORYRELEASED
- From: Jim Myers <email@hidden>
- Date: Tue, 26 Feb 2002 09:30:55 -0700
>
Assuming I have an endpoint that is:
>
>
a) non-blocking
>
b) ack-ing sends
>
c) asynchronous
>
>
is there any circumstance under which
>
T_MEMORYRELEASED won't be received after
>
an OTSnd() call?
>
>
The notifier is loosely:
>
>
AsyncNotifier()
>
{
>
OTEnterNotifier()
>
switch ( code )
>
{
>
case T_MEMORYRELEASED:
>
break;
>
}
>
OTExitNotifier()
>
}
>
>
Is there any chance that T_MEMORYRELEASED
>
gets lost if the notifier is called before
>
the OTSnd() completes?
>
>
This seems to be happening with OS 8.1/OT 1.3.1.
>
I don't seem to have the problem with OS 9.2.2/
>
OT 2.7.9.
>
>
Thanks a huge amount
>
>
Scott Burgess
The purpose of OTEnterNotifier is to allow you to call your own Notifier,
or manipulate the data your Notifier plays with without getting
interference from an asynchronous call. Apple's documentation is unclear
on this point.
If my understanding of OT is correct, OTEnterNotifier in your example is
essentially a redundant call. Functionally, Apple prevents the Notifier
from being called for an endpoint until the current call finishes (this
is especially true for T_DATA events, but I'm not sure about all the
other events). Therefore, and I'm assuming a bit here, OTEnterNotifier is
called before the Asynchronous call happens anyways.
The T_MEMORYRELEASED message just lets you know that memory you allocated
and released via OT's memory allocation has been returned to the heap and
the pointer previously given to that block of memory is no longer valid.
My code sets the pointer/variable I use to NULL so that I don't access
the now invalid pointer without allocating RAM again.
I don't think the T_MEMORYRELEASED event can get lost under normal
circumstances. If you are losing such events, then the only thing I can
suggest is to make sure that the TEndpointInfo is not getting corrupted
somehow. If you have more than one endpoint, you *must* have unique
TEndpointInfo records/memory for each and every endpoint (in other words
don't provide a NULL for your OpenEndpoint call for the TEndpointInfo*
parameter).
HTH
_______________________________________________
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.