[Python-Dev] Getting an optional parameter instead of creating a socket internally

Jesus Cea jcea at jcea.es
Sun Jul 11 17:11:43 CEST 2010


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

On 13/04/10 04:03, exarkun at twistedmatrix.com wrote:
> On 12 Apr, 11:19 pm, jcea at jcea.es wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 04/13/2010 12:47 AM, Antoine Pitrou wrote:
>>> Jesus Cea <jcea <at> jcea.es> writes:
>>>>
>>>> PS: "socket.setdefaulttimeout()" is not enough, because it could
>>>> shutdown a perfectly functional connection, just because it was idle
>>>> for
>>>> too long.
>>>
>>> The socket timeout doesn't shutdown anything. It just puts a limit on
>>> how much
>>> time recv() and send() can block. Then it's up to you to detect
>>> whether the
>>> server is still alive (for example by pinging it through whatever
>>> means the
>>> application protocol gives you).
>>
>> A regular standard library (let say, poplib) would abort, after getting
>> the timeout exception.
>>>> 4. Modify client libraries to accept a new optional socket-like object
>>>> as an optional parameter. This would allow things like transparent
>>>> compression or encryption, or to replace the socket connection by
>>>> anything else (read/write to shared memory or database, for example).
>>>
>>> This could be useful too.
>>
>> I have been thinking about this for years. Do you actually think this
>> could be formally proposed?.
> 
> Every once in a while I make a little bit more progress on the PEP I'm
> working on for this.  If you want to talk more about this, you can find
> me in #python-dev or #twisted on freenode.
> 
> Jean-Paul

Jean-Paul, I would like to have this for 3.2. How is the PEP going?.

- -- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQCVAwUBTDnfL5lgi5GaxT1NAQJOIAP+IAARGsWGeReG21Mc70AxT9e82TqrPY65
053GpfnqDW/poCHdHKv5NeDPso02tDeJvZ53cB23ximQKM9qg1j9XzXP/5AJcjke
eVJaS9K8K6/Z1o97iDZb3Evkt7q2Dn7VG4QjJn6cy9lh841HDRFn/+HIuQLgoMyh
stvK53cj7n4=
=JrAg
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list