Lightwight socket IO wrapper

Michael Ströder michael at stroeder.com
Mon Sep 21 10:29:45 CEST 2015


Marko Rauhamaa wrote:
> Michael Ströder <michael at stroeder.com>:
> 
>> Marko Rauhamaa wrote:
>>> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
>>> are available (Linux).
>>
>> If these options are not available are both option constants also not
>> available? Or does the implementation have to look into sys.platform?
> 
>    >>> import socket
>    >>> 'TCP_CORK' in dir(socket)
>    True

On which platform was this done?

To rephrase myquestion:
How to automagically detect whether TCP_CORK is really available on a platform?

'TCP_CORK' in dir(socket)
or catch AttributeError

sys.platform=='linux2'
hoping that Linux 2.1 or prior is not around anymore...

...

Ciao, Michael.


More information about the Python-list mailing list