[Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Debugging a strange problem today, I got the following result: Sockets open by stdlib libraries are open without the keepalive option, so the system default is used. The system default under linux is no keepalive. So, if you are using a URLlib

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Guido van Rossum
Are you sure about this? ISTM that in most cases when a server goes away unexpectedly the local host will discover this when it next tries to use the socket. Also I recall reading that keepalives are a very controversial concept (since they may actually break connections unnecessarily if the

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:09 AM, Guido van Rossum wrote: Are you sure about this? ISTM that in most cases when a server goes away unexpectedly the local host will discover this when it next tries to use the socket. Also I recall reading that keepalives are

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:09 AM, Guido van Rossum wrote: Also I recall reading that keepalives are a very controversial concept (since they may actually break connections unnecessarily if the internet merely has a hiccup). That is true, but parameters are

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Daniel Stutzbach
On Mon, Apr 12, 2010 at 5:34 PM, Jesus Cea j...@jcea.es wrote: The problem is: linux doesn't uses KEEPALIVE by default. If you believe the problem is with the Linux kernel, perhaps you should take up your case on a more appropriate mailing list? Python's socket module is a fairly low-level

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/13/2010 12:59 AM, Daniel Stutzbach wrote: Most non-trivial applications use select() or poll() to avoid blocking calls and do their own timeout-checking at the application layer, so they don't need KEEPALIVE. I am thinking about python

Re: [Python-Dev] stdlib socket usage and keepalive

2010-04-12 Thread Guido van Rossum
On Mon, Apr 12, 2010 at 3:59 PM, Daniel Stutzbach dan...@stutzbachenterprises.com wrote: On Mon, Apr 12, 2010 at 5:34 PM, Jesus Cea j...@jcea.es wrote: The problem is: linux doesn't uses KEEPALIVE by default. If you believe the problem is with the Linux kernel, perhaps you should take up