Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.04; 'algorithm': 0.04; 'odd': 0.07; 'subject:trying': 0.09; 'cc:addr :python-list': 0.11; 'ack': 0.16; 'bytes;': 0.16; 'delayed,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sockets': 0.16; 'through.': 0.16; 'when,': 0.16; 'write,': 0.16; 'weird': 0.16; 'wrote:': 0.18; "hasn't": 0.19; 'subject:] ': 0.20; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; '13,': 0.31; 'probably': 0.32; 'fri,': 0.33; 'third': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'example,': 0.37; 'how': 0.40; 'first': 0.61; 'guarantee': 0.63; 'satellite': 0.68; 'or...': 0.84; 'edwards': 0.91; 'to:none': 0.92; 'connection,': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=6dXj8SYnvwC5ao5bED/5qAVlsM+gZxqBCX/xeE1gYnc=; b=Pz9V5VU8selgweuQ8Up0LY/QByoHhXWOkMdvc/j6gw1H4CXQ/bjYbPbx4gO7A2+6xs PGANWwgP1n3X4S/Ojythr+f4sZa39K6awJCi7wF2JZtNh3FMrlKBoVm4Ce1aXd0VA6Ft zR5IZoooHDVMyNxrYE2BFZlHajgB54XRA3qtxdk8KvXLmJouOgFfrenwhTDtp6B2vM2a bt72gepwnP1OMU0UkfNa/iEk05N1a10lkMATZ9U1qBsP2+n5wrlaGO8Ca7SRv9TmWl5+ CN+xJISyS+gcD/MpAD2+9nq5LzHfMXnLtH8iNBf5CAmvfP/8hRw6s9VVd4Fsdsk7LoDx mS2w== MIME-Version: 1.0 X-Received: by 10.68.236.133 with SMTP id uu5mr12536978pbc.153.1386858214398; Thu, 12 Dec 2013 06:23:34 -0800 (PST) In-Reply-To: References: Date: Fri, 13 Dec 2013 01:23:34 +1100 Subject: Re: [newbie] trying socket as a replacement for nc From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386858218 news.xs4all.nl 2961 [2001:888:2000:d::a6]:55253 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61716 On Fri, Dec 13, 2013 at 1:16 AM, Grant Edwards wrote: > And it _will_ fail someday in some odd circumstance when, for example, > some customer is be using it via a dial-up PPP connection, or there is > a satellite link in the path, or there's a flakey router somewhere, > or... Or you write, write, write in quick succession. Nagle's Algorithm means that if the first one hasn't yet been acknowledged, the second one will be delayed, which means it'll probably be combined with the third and sent when the first one's ACK comes through. Stream sockets guarantee a stream of bytes; datagram sockets guarantee datagrams. Weird how that goes, isn't it? ChrisA