|
From: | Santos Das |
Subject: | Re: [libmicrohttpd] Sockets remain in CLOSE_WAIT state |
Date: | Sat, 5 Jan 2019 10:04:04 +0530 |
Hi Santos,
CLOSE_WAIT is a TCP state in the kernel after a TCP connection is
finished. It typically lasts like 60--300s, depending on your kernel
configuration (you may want to read up on the TCP state machine).
You can change the time by changing
/proc/sys/net/ipv4/tcp_fin_timeout, but usually this is not an issue
(unless you have _way_ too many TCP connections from the same host, I've
only seen this matter on loopback, in which case usually enabling
keep-alive on the client-side helps).
Summary: this is not an issue in MHD, likely not one for anyone, just a
TCP artifact.
Happy hacking!
-Christian
On 1/4/19 6:29 PM, Santos Das wrote:
> Hi Christian,
>
> Please note I am using suspend-resume and not
> implementing MHD_OPTION_NOTIFY_CONNECTION to close . Not sure when the
> library closes the connection after it receives FIN and move to CLOSE_WAIT.
>
> Any pointers?
>
> thanks, santos
>
> On Fri, Jan 4, 2019 at 10:27 PM Santos Das <address@hidden
> <mailto:address@hidden>> wrote:
>
> Hi Christian,
>
> Wishing you a happy new year!
>
> We have set the MHD_OPTION_CONNECTION_TIMEOUT to 0 and we see that
> all the connections remain in CLOSE_WAIT state.
>
> We also have set the MHD_OPTION_CONNECTION_LIMIT to 1000 .
>
> Any idea what could be wrong ?
>
> Thanks, Santos
>
[Prev in Thread] | Current Thread | [Next in Thread] |