Hello,
In fact i'm still stuck with threads in mozilla, and i'd like to know if you could give me some pointers.
I'm trying to write a firefox extensions to support Apple rendezvous/zeroconf/opentalk. http://www.apple.com/macosx/features/rendezvous/ http://www.dns-sd.org/
Especially the service discovery part of it, to be able to have my bookmark autoupdated with rendezvous enabled services like safari do it. (for printer webadmin, intranet etc)
To acheive this goal i'm using the howl libray (works in win2K/linux/macosx) http://www.porchdogsoft.com/products/howl/docs/
I already use this libreay many times, especiallly to implement rendezvous support in apache.
To use this library you must
1) define the service that you are looking for
2) define call back that will be called when the service define in 1) are found
3) start the discovery
My problem is that 3) is a bit like a while(true), it must run forever, so i need to launch it from a thread (or fork).
Normaly i use pthreads (i'm developping and linux and then port it on mac/win), but i was told my mozilla dev on #developers that i can't use threads directly in firefox extensions. But i must "proxy on the main thread" (that was really an enigm for me).
So i look for docs about it and found that i need to use this: http://www.mozilla.org/projects/xpcom/Proxies.html i even found some example using it in mozilla source code and in this: http://lxr.mozilla.org/seamonkey/source/xpcom/proxy/tests/proxytests.cpp
But i really can't figure how to use it to solve my problem, i tried many things, but it didn't work.
I'm quite new to mozilla dev (3days). I understand how to call c++ function from javascript and get the result using xpcom xpidl etc...
But i really can't figure how to start my little thread, and i'm stuck with it...
I hope that you could help me understand this mistery, i just want to be able to run my thread in background and keep the ui responsive while my thread updates my bookmarks.
If only i have a little example showing how to run while(1) sleep(10); while the ui stay responsive i could go on my development.
thanx again for you time and your help :)
-- Sebastien Estienne _______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
