Hi

I have, since my initial post on this topic, found the "pacemaker" for
this - it is the event queue business - right?

I found some code in TestHTTP.cpp in netlib/test folder of mozilla
sources. That explained everything (almost).

Now the problem is, I have a PR_Cleanup() in my main thread and even
after the entire URL has been read, the main thread does not exit. It
seems to wait for something. What could that be?

With best regards
Chandra

PS: Some code (from TestHTTP.cpp)
    nsCOMPtr<nsIEventQueueService> eqs = 
             do_GetService(kEventQueueServiceCID, &rv);
    RETURN_IF_FAILED(rv, "do_GetService(EventQueueService)");

    rv = eqs->CreateMonitoredThreadEventQueue();
    RETURN_IF_FAILED(rv, "CreateMonitoredThreadEventQueue");

    rv = eqs->GetThreadEventQueue(NS_CURRENT_THREAD, &gEventQ);
    RETURN_IF_FAILED(rv, "GetThreadEventQueue");

    /*snip - do the stuff till AsyncOpen for your favorite URL 
    - found in my original post*/

    while (gKeepRunning)
        gEventQ->ProcessPendingEvents();

Reply via email to