[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] http push with libmicrohttpd
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] http push with libmicrohttpd |
Date: |
Fri, 4 Jan 2008 07:42:05 -0700 |
User-agent: |
KMail/1.9.7 |
On Friday 04 January 2008, Patrick Moore wrote:
> Hi all,
>
> I apologise if this is covered elsewhere, but I've been unable to find any
> mention of it.
>
> I'm hoping to use libmicrohttpd to provide status updates on a program
> which keeps track of subscribers. Ideally, rather than have to force a
> refresh ever n seconds on the client side, I was wondering if it was
> possible to have libmicrohttpd push the data down to the client?
Well, the usual HTTP method would be to have the client re-request every n
seconds (with JavaScript or so). You could of course send data incrementally
to the client (with more every n seconds); MHD allows you to specify a
response callback which may return "nothing" until the time comes -- or
simply block n seconds in multi-threaded mode -- that'd give the client the
data incrementally over time. The main issue with that would be to make sure
that the browser renders the datastream as it comes (and does not wait for
the transmission to complete).
> Has anyone attempted this, and if so are there any example applications
> out there?
I don't have an example, but it should be possible by design as far as MHD is
concerned.
Best regards,
Christian