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


Groups > comp.lang.python > #96926

Re: Lightwight socket IO wrapper

Path csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.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.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '21,': 0.07; 'socket': 0.07; 'cc:addr:python-list': 0.09; 'encoding.': 0.09; 'buffering': 0.16; 'exclusion': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.16; '>>>': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sep': 0.22; 'needed.': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'socket,': 0.29; 'there.': 0.30; 'message.': 0.33; 'safely': 0.33; 'received:google.com': 0.35; 'next': 0.35; 'problem.': 0.35; 'too': 0.36; 'data.': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'anything': 0.38; 'mean': 0.38; 'means': 0.39; 'sure': 0.39; "didn't": 0.39; 'where': 0.40; 'ever': 0.60; 'your': 0.60; '"too': 0.84; 'absolutely': 0.88; 'imagine': 0.96
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 :cc:content-type; bh=RGb6gk6LWZkYM8e/Zk2pWQxHaNiYbgd1VL0cRFjoj1E=; b=QhVIap9qBJk0OimJFZ3lX25QviSJWL4b1VgMwlBa3p4gn+iOuZnaupfvvoQdbNSFA8 cWvyPN6SdhqnsfAIROxrWATRwVB6gHy9ST/M7VeYDZXjaPmpdy2KVP2UO40uLisB3By+ n7vqcAAOTa+8H5RCxYZcs4Bx55LAODHUWwAznMLe9VziGzD9stYVE1eRHDVBpjJqwxap fY9DKqQjPQK51/o6+5e6HtuXAsATEkEjUpF8B4nlWeiC9vKagglUbWk1ui6Y3/nXhXr1 7K4XAQ/aTJAjvAT7sVjNiVzI4IVKKHJihyxRIk+NjyCa7U6r2XY6CQr22xlxH0136y93 OstQ==
MIME-Version 1.0
X-Received by 10.107.36.72 with SMTP id k69mr23197911iok.157.1442825148693; Mon, 21 Sep 2015 01:45:48 -0700 (PDT)
In-Reply-To <871tdsp3ox.fsf@elektro.pacujo.net>
References <CAPTjJmpuYp5uEDnRJqC9qKj-YkNRx1jW48WsRyRn+U0rzGiTYw@mail.gmail.com> <20150921062713.GA77399@cskk.homeip.net> <mailman.23.1442822248.28679.python-list@python.org> <876134p5hw.fsf@elektro.pacujo.net> <mailman.24.1442822846.28679.python-list@python.org> <871tdsp3ox.fsf@elektro.pacujo.net>
Date Mon, 21 Sep 2015 18:45:48 +1000
Subject Re: Lightwight socket IO wrapper
From Chris Angelico <rosuav@gmail.com>
To Marko Rauhamaa <marko@pacujo.net>
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.25.1442825151.28679.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442825151 news.xs4all.nl 23720 [2001:888:2000:d::a6]:46476
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96926

Show key headers only | View raw


On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>> On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
>>> You can read a full buffer even if you have a variable-length length
>>> encoding.
>>
>> Not sure what you mean there. Unless you can absolutely guarantee that
>> you didn't read too much, or can absolutely guarantee that your
>> buffering function will be the ONLY way anything reads from the
>> socket, buffering is a problem.
>
> Only one reader can read a socket safely at any given time so mutual
> exclusion is needed.
>
> If you read "too much," the excess can be put in the application's read
> buffer where it is available for whoever wants to process the next
> message.

Which works only if you have a single concept of "application's read
buffer". That means that you have only one place that can ever read
data. Imagine a

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


Thread

Re: Lightwight socket IO wrapper Chris Angelico <rosuav@gmail.com> - 2015-09-21 17:57 +1000
  Re: Lightwight socket IO wrapper Marko Rauhamaa <marko@pacujo.net> - 2015-09-21 10:59 +0300
    Re: Lightwight socket IO wrapper Chris Angelico <rosuav@gmail.com> - 2015-09-21 18:07 +1000
      Re: Lightwight socket IO wrapper Marko Rauhamaa <marko@pacujo.net> - 2015-09-21 11:38 +0300
        Re: Lightwight socket IO wrapper Chris Angelico <rosuav@gmail.com> - 2015-09-21 18:45 +1000
          Re: Lightwight socket IO wrapper Marko Rauhamaa <marko@pacujo.net> - 2015-09-21 11:48 +0300
            Re: Lightwight socket IO wrapper Marko Rauhamaa <marko@pacujo.net> - 2015-09-21 11:49 +0300
        Re: Lightwight socket IO wrapper Chris Angelico <rosuav@gmail.com> - 2015-09-21 18:50 +1000
          Re: Lightwight socket IO wrapper Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-22 07:59 +0000

csiph-web