Re: InitOpentransportInContext
Re: InitOpentransportInContext
- Subject: Re: InitOpentransportInContext
- From: Alice Hartley <email@hidden>
- Date: Mon, 24 Feb 2003 14:04:14 -0500
>
At 16:30 -0500 21/2/03, Alice Hartley wrote:
>
>When a machine wakes from sleep we dispose of all
>
>the OpenTransport loose ends and call
>
>InitOpentransportInContext again. This works
>
>fine on OS9 but gets an error on OSX (10.2.1, 10.2.4)
>
>complaining about invalid argument (i think).
>
>It doesn't fail 100% of the time but most of the
>
>time it does.
>
>Any clues about how to fix this would be
>
>appreciated.
>
>
What exact error code do you get? Can you show us how you init OT
>
and how you shut it down? And finally, why do you do this at all?
>
There's no reason to reinitialise OT after coming out of sleep,
>
especially on Mac OS X.
Can you quantify "especially". It certainly used to be necessary.
>
Error code -3221
init:
err = InitOpentransportInContext (kInitOTForApplicationMask, our-context);
shutdown:
OTCloseProvider of any endpoints we have cached, etc.
Sorry for the Lisp code. I hope it conveys the general idea.
Lisp code below - the function ot-free-endpoint is complicated:
(defun opentransport-cleanup ()
; Close any freelisted endpoints.
(do* ()
((null *opentransport-class-endpoint-freelists*))
(let* ((cell (pop *opentransport-class-endpoint-freelists*)))
(dolist (ep (cdr cell))
(#_OTCloseProvider ep))))
(do* ()
((null *opentransport-class-proxies*))
(let* ((proxy-context (cdr (pop *opentransport-class-proxies*))))
(with-macptrs ((ep (pref proxy-context :ot-context.ref)))
(ot-free-endpoint ep proxy-context nil))))
(do* ()
((null *opentransport-config-alist*))
(#_OTDestroyConfiguration (cdr (pop *opentransport-config-alist*))))
(setq *opentransport-initialized* nil)
(when *opentransport-notifier*
(#_DisposeOTNotifyUPP *opentransport-notifier*))
(setq *opentransport-notifier* nil))
Thanks
_______________________________________________
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.