W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Re: activate the eventloop

From: Peter Stamfest <peter.stamfest@eunet.at>
Date: Wed, 20 Sep 2000 18:46:32 +0200 (CEST)
To: "Derruau, Mathias" <Mathias_Derruau@hplb.hpl.hp.com>
cc: "'www-lib@w3.org'" <www-lib@w3.org>
Message-ID: <Pine.LNX.4.21.0009201841560.9684-100000@peter.stamf.pr.at>
On Wed, 20 Sep 2000, Derruau, Mathias wrote:

> Date: Wed, 20 Sep 2000 11:06:59 +0100
> From: "Derruau, Mathias" <Mathias_Derruau@hplb.hpl.hp.com>
> To: "'www-lib@w3.org'" <www-lib@w3.org>
> Subject: Re: activate the eventloop
> Resent-Date: Wed, 20 Sep 2000 06:07:13 -0400 (EDT)
> Resent-From: www-lib@w3.org
> Thank you for the tip,
> I now have one thread sending messages to the eventloop thread through a UDP
> socket.
> It works fine for the first message passed, the callback is activated, as
> well as the request terminator, but if my main thread wants to pass a second
> message, it doesn't seem to be caught by the eventloop thread.
> What do I have to do to make the eventloop thread listen again on the socket
> (tried to register the event again in the callback function, but it results
> in an infinite loop)?

All I had to do prior to starting the event loop was the following:

    ev = HTEvent_new(commandCallback,
                     server_data,   /* some event specific data */
                     timer);        /* non zero timer value */

    HTEvent_register(sock, HTEvent_READ, ev);

Where sock used to be a local Unix Socket (I wouldn't trust UDP, in
addition, you would also have to check that nobody else connects to the
socket via the network). For me this worked without problems, subsequently
written data caused the commandCallback to be triggered (again).

> Thanks for help
> Mathias Derruau
> PS: when i set the mode to non-preemptive, the chunk resulting in a request
> is not complete. Anyone any idea about this?

Received on Wednesday, 20 September 2000 12:48:55 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:53 UTC