• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kStreamIoctlEvent and T_MEMORYRELEASED question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kStreamIoctlEvent and T_MEMORYRELEASED question


  • Subject: Re: kStreamIoctlEvent and T_MEMORYRELEASED question
  • From: "Thomas E. Knowlton, Jr." <email@hidden>
  • Date: Thu, 11 Mar 2004 15:01:04 -0700

> Subject: Re: kStreamIoctlEvent and T_MEMORYRELEASED question
> To: email@hidden
> From: Quinn <email@hidden>
> Date: Thu, 11 Mar 2004 11:07:02 +0000
>
> At 13:17 -0700 10/3/04, Thomas E. Knowlton, Jr. wrote:
>> ...
> No. There are no guarantees at all abou the ordering of
> T_MEMORYRELEASED events.
>
>> ...
> No! Under no circumstances should you spin in a notifier.
>
> What's the actual problem you're trying to solve?

I'm trying to be event driven to figure out when it's OK to close the
endpoint to be sure to recover OT resources. A few different cases: the
local user manipulates the UI to ask to quit the app, the remote user
hangs up, or the local configuration changes causing
kOTProviderWillClose out from underneath me.
If the local user manipulates the UI, that's fine: I'll call OTIoctl()
to flush sends, sit in the system task code spinning until I get all
the T_MEMORYRELEASED I'm waiting for, then OTSndDisconnect(). The
handler for T_DISCONNECTCOMPLETE calls OTUnbind(), T_UNBINDCOMPLETE
handler calls OTCloseProvider, and everyone's happy. I return to the
event loop when I notice that these events have taken place, since
they are able to preempt my system task code.

If the remote user hangs up, I get T_DISCONNECT, and need a way to 1)
flush the sends, 2) wait for outstanding T_MEMORYRELEASED and 3) close
the EP.

If I get kOTProviderWillClose, it's the same situation as for
T_DISCONNECT: I'm on the notifier, and so serialized against other
notifier events, but I have to wait and then close (to recover my
allocated memory AND OT resources).

I don't want to SetSynchronous() because it complicates my notifier
(then I have to check whether the EP is in synchronous or anynchronous
mode for certain event handlers). To avoid complicating the notifier, I
could do a total rewrite using MP services, but for now let's keep that
option off the table.

Recommendations?

Thanks,
--
Tommy

>
>
> S+E
> --
> Quinn "The Eskimo!"
> <http://www.apple.com/developer/>
> Apple Developer Technical Support * Networking, Communications,
> Hardware
_______________________________________________
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.


  • Prev by Date: Re: TCP/IP connection via Ethernet
  • Next by Date: Why would CFSocketSendData fail with EPERM?
  • Previous by thread: Re: kStreamIoctlEvent and T_MEMORYRELEASED question
  • Next by thread: localhost comm btwn X and Classic w/o LAN??
  • Index(es):
    • Date
    • Thread