Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:: [': 0.04; 'aggregate': 0.07; 'sake': 0.09; 'subject:trying': 0.09; '[it': 0.16; 'reliability.': 0.16; 'sockets': 0.16; 'tcp': 0.16; 'to:name:python list': 0.16; 'udp,': 0.16; 'wrote:': 0.18; 'split': 0.19; 'thu,': 0.19; 'not,': 0.20; 'subject:] ': 0.20; 'appears': 0.22; "haven't": 0.24; 'right.': 0.26; 'switch': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'performance': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; '12,': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'equipment': 0.61; 'guarantee': 0.63; 'fragment': 0.84; 'undoubtedly': 0.84; 'url:topic': 0.84; 'edwards': 0.91; '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:to :content-type; bh=CB3njq72dYuRg2rbNujhvmRhRv828BkExNjzhTrsKkg=; b=XZxbxVOYntGf2O1ui9F16OlhXW+zqeGJN4eI7NxwVjNbAnslQ+HiLO4f0jXyuHP1GA HWiNftXCjKyJ6lRbTz8jzaiNfYjqukWLtUm/EILa0kKjWGADfNJAD9Q+RALvU/x0V04L N9P4D/DiXJaaY2q0XOgbqfi5YqBedux9Juuu4Lq9ElQTxxgrjqo869HFh029TBrvTRN4 pS4cqHRfMApO41NGLyJeILwodOSYndIotwOMFiMTKNQDh+gb01qgRf0JNvOrg4OPfK+B zYtzkQCNhSulTGVEzMJU5B8TZeFdMFiFeWj7u9Ev6mr3TU7YB5nskLkStWTJK7uVz/VG sEXw== MIME-Version: 1.0 X-Received: by 10.180.77.49 with SMTP id p17mr112088wiw.30.1386883636767; Thu, 12 Dec 2013 13:27:16 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Dec 2013 13:27:16 -0800 Subject: Re: [newbie] trying socket as a replacement for nc From: Dan Stromberg To: Python List Content-Type: text/plain; charset=ISO-8859-1 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386883640 news.xs4all.nl 2920 [2001:888:2000:d::a6]:36242 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61758 On Thu, Dec 12, 2013 at 6:16 AM, Grant Edwards wrote: >> Sockets reserve the right to split one socket.send() into multiple >> socket.recv()'s on the other end of the communication, or to aggregate >> multiple socket.send()'s into a single socket.recv() - pretty much any way >> the relevant IP stacks and communications equipment feel like for the sake >> of performance or reliability. > > Just to be pedantic: _TCP_ sockets reserver that right. UDP sockets > do not, and do in fact guarantee that each message is discrete. [It > appears that the OP is undoubtedly using TCP sockets.] I haven't done a lot of UDP, but are you pretty sure UDP can't at least fragment large packets? What's a router or switch to do if the Path MTU isn't large enough for an original packet? http://www.gamedev.net/topic/343577-fragmented-udp-packets/