Path: csiph.com!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'indicating': 0.05; 'properly.': 0.07; '22,': 0.09; 'pressing': 0.09; 'received:internal': 0.09; 'python': 0.10; 'stack': 0.13; '(there': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:compute4.internal': 0.16; 'received:messagingengine.com': 0.16; 'skip:n 50': 0.16; 'tcp': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'circular': 0.18; 'driver': 0.18; 'pointed': 0.18; 'input': 0.18; '2015': 0.20; 'interpret': 0.22; 'sends': 0.22; 'sep': 0.22; 'pass': 0.22; 'wrote': 0.23; '(you': 0.23; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'probably': 0.31; "can't": 0.32; 'problem': 0.33; 'tue,': 0.34; 'skip:> 10': 0.35; 'something': 0.35; "isn't": 0.35; 'supports': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'client': 0.37; 'one,': 0.37; 'seem': 0.37; 'received:66': 0.38; 'drop': 0.38; 'end': 0.39; 'data': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'header:Message- Id:1': 0.61; 'between': 0.65; 'believe': 0.66; 'effectively,': 0.84; 'technically': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=hcrkRCdRbUAGBISXPMhmukkpSaw=; b=u0nJl0 eW3tfHhZYI//Tl9zzL3jFfbLEucVlp9I5hNS6tYb74N+QCe/pRy/4lVJkp/p/uIY JFJcFBF7vmpiE7SRBtvARadWQsROw6DGCVND09G7shkkSmPDD8MoTMAzTbpZnRXC AMpfhLpXPtJT5r75I66VJMm1c/+EEqFD2cknc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=hcrkRCdRbUAGBIS XPMhmukkpSaw=; b=jgfiOcm5fAUUJGG+ZhPyNFIM7SbHMMNYajkRvVMxMIFAlvO VyMoA6DPwG8H6ElF0aE+M4vHz7kzqJu5UCCbl05HkUKI2nVVMBMDUs4MHe3V0UVi JvdGY7x4SvRLzgYVKkFfenmZB4Ark/QqEc7y8i8FPVCeWWA29+aSidiz/oss= X-Sasl-Enc: Lap+oxbrBX3OsYir3Tbuchp1jG7SGQZ7i0fhObGTiEwz 1442965974 From: Random832 To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-39fe9c8e Subject: Re: Lightwight socket IO wrapper Date: Tue, 22 Sep 2015 19:52:54 -0400 In-Reply-To: References: 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442965978 news.xs4all.nl 23758 [2001:888:2000:d::a6]:42492 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97011 On Tue, Sep 22, 2015, at 15:45, James Harris wrote: > "Dennis Lee Bieber" wrote in message > news:mailman.12.1442794762.28679.python-list@python.org... > > On Sun, 20 Sep 2015 23:36:30 +0100, "James Harris" > > declaimed the following: > >>Receiving no bytes is taken as indicating the end of the > >>communication. > >>That's OK for TCP but not for UDP so there should be a way to > >>distinguish between the end of data and receiving an empty datagram. > >> > > I don't believe UDP supports a truly empty datagram (length of 0) -- > > presuming a sending stack actually sends one, the receiving stack will > > probably drop it as there is no data to pass on to a client (there is > > a PR > > at work because we have a UDP driver that doesn't drop 0-length > > messages, > > but also can't deliver them -- so the circular buffer might fill with > > undeliverable headers) > > As others have pointed out, UDP implementations do seem to work with > zero-byte datagrams properly. Again, I would rather see that in the > Python documentation which is what, effectively, forms a contract that > we should be able to rely on. Isn't this technically the same problem as pressing ctrl-d at a terminal - it's not _really_ the end of the input (you can continue reading after), but it sends the program something it will interpret as such?