libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] threading model question


From: Christian Grothoff
Subject: Re: [libmicrohttpd] threading model question
Date: Sat, 29 Oct 2011 15:28:18 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111004 Icedove/3.0.11

On 10/28/2011 10:49 PM, Sven Geggus wrote:
Christian Grothoff schrieb am Freitag, den 28. Oktober um 15:01 Uhr:

Well, that's technically not required.  You can simply integrate your data-
polling loop into the external select loop of MHD and in the response
callbacks for data-aquisition return 0 (which will be interpreted as "no data
available yet, try again in the next round of select").  Note that MHD will
then NOT put the respective sockets into your write set, so you would not end
up busy-waiting.

Hm, looks like I do not fully understand this suggestion :(

Attached is a modified version fo your fileserver_example_external_select.c
example.

I just added a (fake) data acquisition loop which is currently using a 4
second interval.  But how can I synchronice the http output for the
http data requests via http (and only for these) now?

Sven


I've attached a completed example that writes every 4s a "Round %d" string to the client (based on the trigger). I've added comments where appropriate.

Happy hacking,

Christian

Attachment: fileserver_example_external_select.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]