I need to "talk" to an instance of mozilla, to have it do some things
now and then.  Mozilla will have a javascript application running,
and I want this application to listen for external events.

Is there any easy way to have an external application send some
data to a running javascript application?

I tried to have the javascript listen on a named pipe (with XPCOM)
but the asyncOpen() blocks until the writer opens its end of the
pipe.  I find it difficult to browse the documentation on xulplanet
when I don't know what to look for.  What I would like is to have
the application run until someone opens the named pipe and writes
someting in it.  I thought one callback would be called when the
open succeeds, I would then register another callback for anything
readable (with asyncWait() ?).  I would just queue everything I read
(asynchronously) until the writer closes the pipe and then act on what
I received.  All that without blocking the application that is running.

Any hints?

My next best guess is building my own component in C++ that will
wait for the IO in its own thread and call some javascript callback
when ready.  I have no idea yet if this is possible.  I think I'm
way too far, there must be something easy I missed...  If that's the
way to go, can anyone point me to some documentation on how to do it?

Thanks
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to