[Top][All Lists]

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

Re: [libmicrohttpd] running in main thread

From: silvioprog
Subject: Re: [libmicrohttpd] running in main thread
Date: Mon, 2 Dec 2019 14:22:48 -0300

Dear friends.

On Mon, Dec 2, 2019 at 12:49 PM José Bollo <address@hidden> wrote:
No in fact the question is serious. There is no simple way to let run
MHD on the main thread. It requires implementing an external
poll/select loop.

Can you provide an integrated main that serves and doesn't return until

IMHO, it would be really very useful. Unfortunately, without this feature, we need to implement hard logic using select()/epoll() by hand in our console applications.

In Rust and Pascal we generally call some locking function to stay "running" application, in those cases, it would be nice to call something like this:

static int my_awesome_callback(void *cls) {
  return application_terminated ? MHD_YES : MHD_NO;

MHD_main_loop(my_awesome_callback, NULL);

so the MHD_main_loop() would hold the console application without exiting, something like getchar() does. Many other C/Rust libraries implements this loop, for example:

1. libsoup / C:
2. mongoose / C:
3. warp / Rust:
4. actix-web / Rust:

This is a very appreciated feature in many other libraries/frameworks.

Best regards
José Bollo
Silvio Clécio

reply via email to

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