Re: activate the eventloop

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 */
                     HT_PRIORITY_MAX,
                     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?
> 

peter

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