Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'python3': 0.05; 'socket': 0.07; 'machines.': 0.09; 'python': 0.10; 'constants': 0.16; 'evaluates': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'wrote:': 0.16; 'detect': 0.18; '>>>': 0.20; 'windows': 0.20; 'sep': 0.22; 'sorry,': 0.22; 'bit': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'skip:( 20': 0.28; 'fedora': 0.29; 'option': 0.31; 'options': 0.33; 'michael': 0.33; 'false': 0.35; 'machines': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'sure': 0.39; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'hope': 0.61; 'more': 0.63; '>>>>>': 0.66; 'try.': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=CvRCCSMD c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=IkcTkHD0fZMA:10 a=FqUJXrfVAAAA:8 a=bGml7TF1QM8cg7Y_wUcA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett@:2500 Subject: Re: Lightwight socket IO wrapper To: python-list@python.org References: <20150921015514.GA70236@cskk.homeip.net> <876134e683.fsf@elektro.pacujo.net> <87a8sgp5ln.fsf@elektro.pacujo.net> <87wpvknoq8.fsf@elektro.pacujo.net> From: MRAB Date: Mon, 21 Sep 2015 13:26:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <87wpvknoq8.fsf@elektro.pacujo.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442838425 news.xs4all.nl 23779 [2001:888:2000:d::a6]:39118 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96936 On 2015-09-21 09:47, Marko Rauhamaa wrote: > Michael Ströder : > >> Marko Rauhamaa wrote: >>> Michael Ströder : >>> >>>> 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? > > Python3 on Fedora 21. > Python2 on RHEL4. > > Sorry, don't have non-Linux machines to try. > >> How to automagically detect whether TCP_CORK is really available on a >> platform? > > I sure hope 'TCP_CORK' in dir(socket) evaluates to False on non-Linux > machines. > On Windows 10: Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> 'TCP_CORK' in dir(socket) False >>>