[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] How to detect when the client closes the connection
Re: [libmicrohttpd] How to detect when the client closes the connection in libmicrohttpd
Thu, 2 Nov 2017 14:47:32 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
You could use MHD_CONNECTION_INFO_CONNECTION_FD to obtain the socket of
a client, and then call poll/select/epoll on that yourself. Running
'recv' is likely to have unintended side-effects ;-).
On 11/02/2017 08:40 AM, Andrew Oseredchuk wrote:
> Im writing server application based on libmicrohttpd. Clients send
> requests to server and server run a new process that is responsible for
> responce. Server process needs some time to prepare responce. During
> this time client could close connection.
> Is where a way how server/libmicrohttpd could detect connection abort
> and stop server process execution? Or is where a way we can get directly
> to libmicrohttpd socket to run "recv" on it in some background thread?
> Thank you in advance,
Description: OpenPGP digital signature