-----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