libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Orphan TCP sockets


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Orphan TCP sockets
Date: Wed, 13 Jun 2012 14:09:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120506 Lightning/1.0b1 Icedove/3.0.11

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/12/2012 04:05 PM, Enrico Migliore - FATTI srl wrote:
> Hi,
> 
> I'm reading the source code and I got a question.
> 
> 
> Let's say that a browser crashes after opening and using some sockets.
> 
> The browser can't close the sockets since it just crashed.
> 
> That means that there's no way for the MHD deamon to know that the
> client application crashed.

Not true, the OS would still close the TCP stream.

> I wonder what happens to the open sockets?

The OS will close them.  The case you're thinking about is more when the
OS crashes or you have a power outage.

> Will MHD close the sockets after a time out? If yes, how long is the
> timeout?

Timeout is the correct answer.   In order to handle this possibility,
you as the application developer must specify a timeout option to ensure
that TCP connections will eventually be closed by MHD.

See MHD_OPTION_CONNECTION_TIMEOUT in the header/documentation for details.


Happy hacking!

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/YgxMACgkQv2Bwi0hCbH5FmQCePrTKpiXU/L82uhbE/zBq26bF
37YAnievpNq7DGV2RpRNY7W0Lmhuv41X
=ovOG
-----END PGP SIGNATURE-----



reply via email to

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