|
From: | Kunal Ekawde |
Subject: | Re: [libmicrohttpd] Regarding Flow control |
Date: | Tue, 18 Sep 2018 17:52:34 +0530 |
On 09/18/2018 12:23 PM, Kunal Ekawde wrote:
> Thanks Christian,
> So as a solution we need to have a timer for such cases and on timer
> expiry , resume the connection post which as data is not available,
> either error respond or close connection.
Yes, basically if you suspend to perform some asynchronous activity that
needs a timeout, you need to manage that timeout.
> If we close the connection, we
> shall loose the pending requests on that connection right ?
Yes, if you "close" i.e. by returning "MHD_NO".
> and if we
> error respond, we shall get pending messages on that connection right
> (number of pending messages would depend on
> MHD_OPTION_CONNECTION_MEMORY_LIMIT?)?
If you respond, other requests on the connection will then be processed,
but not limited by the MEMORY_LIMIT. MHD won't use more RAM per
connection than allowed by MEMORY_LIMIT, but the OSes for client and
server negotiate a TCP buffer which is really what limits network
transmissions. And the client just won't be able to transmit more
requests than what that TCP buffer allows until you resume, but in
theory the number of requests that can be pipelined is unlimited.
> If the case was client side disconnection, post resume, we should get
> notify callback with reason 'MHD_REQUEST_TERMINATED_WITH_ERROR' ? so we
> can do cleanup right ?
Yes.
[Prev in Thread] | Current Thread | [Next in Thread] |