Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96905

Re: Lightwight socket IO wrapper

Path csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; '21,': 0.07; 'prefix': 0.07; 'cc:addr:python-list': 0.09; '16-bit': 0.09; "hasn't": 0.15; '"got': 0.16; 'all"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'seconds,': 0.16; 'sequencing': 0.16; 'tcp': 0.16; 'udp,': 0.16; 'well-known': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'example.': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'dropped': 0.22; 'problem:': 0.22; 'sep': 0.22; 'am,': 0.23; 'passing': 0.23; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; "doesn't": 0.26; 'example': 0.26; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'sequence': 0.27; 'embed': 0.29; 'starts': 0.29; 'there.': 0.30; 'usually': 0.33; 'stands': 0.33; 'handle': 0.34; 'add': 0.34; 'server': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'protocol': 0.35; 'but': 0.36; 'should': 0.36; '(and': 0.36; 'heard': 0.36; 'subject:: ': 0.37; 'one,': 0.37; 'monitor': 0.38; 'mean': 0.38; 'end': 0.39; 'does': 0.39; 'build': 0.40; 'field': 0.60; 'address': 0.61; 'back': 0.62; 'matter': 0.63; 'fire': 0.63; 'great': 0.63; 'within': 0.64; 'limit': 0.65; 'chrisa': 0.84; 'inherent': 0.84; 'to:none': 0.91; 'alone.': 0.91; 'dennis': 0.91; 'fragment': 0.91; 'responses': 0.93
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=S7/YtkuXJCfLLjxTxJc+bhhXh84h7Cs5g8AtwiaDt7g=; b=djnEDLPI0lZ2Q1J73ElCGVEbC0NdSFtkmOLE/vEMvgO9M8b+fCSJiy72/acGb6iEMV aI7w8JoVioRFbF/NCq7ZRLj9lu3lV8TvSifSrJoFQ8qskyWX5euRweJdSRBOVvjHgFrz AF7AfZEkN0nvLAbkTiY786zzjNtW88ZQThqNJW7Nsuz1xeiY7w1gwYi7DOxaGdlNd3Xc mHV83rdaz/+qqSLdDriNXdFiqL/KH38vMKNBecuqXIqQ5XKW5Cqn7duqDSs4TMDVoBOP whAr9N7VAha4/d3rqHysdDGSF8x/nEDNDP/U+gCkJeXEAJ9B77sKK8mpzA7KXGTmqTEb LnYg==
MIME-Version 1.0
X-Received by 10.50.50.198 with SMTP id e6mr8351051igo.13.1442795693875; Sun, 20 Sep 2015 17:34:53 -0700 (PDT)
In-Reply-To <e3huva94gieuvpfucu1oa9qv4hrp12b5oe@4ax.com>
References <mtm18o$9fm$1@dont-email.me> <mailman.37.1442754893.21674.python-list@python.org> <mtnc9q$pqs$1@dont-email.me> <e3huva94gieuvpfucu1oa9qv4hrp12b5oe@4ax.com>
Date Mon, 21 Sep 2015 10:34:53 +1000
Subject Re: Lightwight socket IO wrapper
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14.1442795696.28679.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442795696 news.xs4all.nl 23856 [2001:888:2000:d::a6]:58668
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 5207
X-Received-Body-CRC 3269259259
Xref csiph.com comp.lang.python:96905

Show key headers only | View raw


On Mon, Sep 21, 2015 at 10:19 AM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
>         Even if the IP layer has to fragment a UDP packet to meet limits of the
> transport media, it should put them back together on the other end before
> passing it up to the UDP layer. To my knowledge, UDP does not have a size
> limit on the message (well -- a 16-bit length field in the UDP header). But
> since it /is/ "got it all" or "dropped" with no inherent confirmation, one
> would have to embed their own protocol within it -- sequence numbers with
> ACK/NAK, for example. Problem: if using LARGE UDP packets, this protocol
> would mean having LARGE resends should packets be dropped or arrive out of
> sequence (and since the ACK/NAK could be dropped too, you may have to
> handle the case of a duplicated packet -- also large).
>

If you're going to add sequencing and acknowledgements to UDP,
wouldn't it be easier to use TCP and simply prefix every message with
a two-byte length?

UDP is great when order doesn't matter and each packet stands entirely
alone. DNS is a well-known example - the question "What is the IP
address for www.rosuav.com?" doesn't in any way affect the question
"What is the mail server for gmail.com?", so you fire off UDP packets
for each one, and get responses whenever you get them. UDP's also
perfect for a heartbeat system - you send out a packet every
however-often, and if the monitor hasn't heard from you in X seconds,
it starts alerting people. No need for responses of any kind there.
But for working with a stream, I usually find it's a lot easier to
build on top of TCP than UDP.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Lightwight socket IO wrapper "James Harris" <james.harris.1@gmail.com> - 2015-09-20 11:22 +0100
  Re: Lightwight socket IO wrapper Akira Li <4kir4.1i@gmail.com> - 2015-09-20 16:15 +0300
    Re: Lightwight socket IO wrapper "James Harris" <james.harris.1@gmail.com> - 2015-09-20 23:36 +0100
      Re: Lightwight socket IO wrapper Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-20 20:19 -0400
        Re: Lightwight socket IO wrapper Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-09-21 17:46 +1200
        Re: Lightwight socket IO wrapper Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-21 11:25 +0000
        Re: Lightwight socket IO wrapper "James Harris" <james.harris.1@gmail.com> - 2015-09-22 20:45 +0100
          Re: Lightwight socket IO wrapper Random832 <random832@fastmail.com> - 2015-09-22 19:52 -0400
            Re: Lightwight socket IO wrapper Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-09-23 12:47 +1200
      Re: Lightwight socket IO wrapper Chris Angelico <rosuav@gmail.com> - 2015-09-21 10:34 +1000
      Re: Lightwight socket IO wrapper Akira Li <4kir4.1i@gmail.com> - 2015-09-21 06:07 +0300
        Re: Lightwight socket IO wrapper "James Harris" <james.harris.1@gmail.com> - 2015-09-22 21:05 +0100
          Re: Lightwight socket IO wrapper Marko Rauhamaa <marko@pacujo.net> - 2015-09-23 00:00 +0300
            Re: Lightwight socket IO wrapper "James Harris" <james.harris.1@gmail.com> - 2015-09-22 22:28 +0100

csiph-web