On Jun 1, 10:53 am, [EMAIL PROTECTED] wrote:
> Hi, all:
> I want to test the ansyc socket through xpcshell, so I set up a
> eventLoop waiting for ansyc read, but I didn't find any method  to
> break the event loop after process. Every time I want exit the test
> procedure, I had to kill the process and losed all output. I have try
> the destroyThreadEventQueue method, event try to interrupt current
> thread but it seen nothing happen, who can tell me how to interrupt
> the event loop?  thanks.
>
> I set up the the event loop through these procedure:
>
> var _eqs = Components.classes["@mozilla.org/event-queue-service;
> 1"].getService(nsIEventQueueService);
>         _eqs.createMonitoredThreadEventQueue();
>         var queue =
> _eqs.getSpecialEventQueue(_eqs.CURRENT_THREAD_EVENT_QUEUE);
>
> //do socket init and write some data
>
> queue.eventLoop();

http://bonsai.mozilla.org/cvsblame.cgi?file=%2Fmozilla%2Fxpcom%2Fthreads%2FnsIEventQueue.idl&rev=1.5&mark=105#69

doesn't work?

note that I never really used eventLoop, I always used something like

while (this.loop)
 query.processPendingEvents();

and then have the other thread change this.loop to false when it's
done.

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to