libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] MHD in "worker processes" mode


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD in "worker processes" mode
Date: Fri, 10 Jun 2016 13:37:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0

On 06/10/2016 02:04 AM, silvioprog wrote:
> Hello,
> 
> Please take a look at this question and the first answer:
> 
> http://askubuntu.com/questions/399431/how-many-nginx-processes-should-there-be
> 
> It raise a question: can I use the worker processes approach with MHD?
> If I understood, it need to up two or more process, but when I try that:
> "Failed to bind to port 8080: Address already in use".

You can have a parent process do the binding and then share the listen
socket with child processes. Or, you can on most OSes set the binding
policy to allow multiple processes to listen to the same socket.

In all of these cases, you should use MHD_OPTION_LISTEN_SOCKET to pass a
pre-bound socket to MHD, so that you can open, bind, set options and
share the socket, instead of letting MHD open a fresh listen socket.

Attachment: 0xE29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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