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


Groups > comp.lang.python > #91461

Re: Accessing DataSocket Server with Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin.stu.neva.ru!nntp.spacedump.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!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.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; '(even': 0.05; '480': 0.05; 'bytes.': 0.07; '75,': 0.09; 'bytes,': 0.09; 'chunks': 0.09; 'delimited': 0.09; 'overridden': 0.09; 'tcp/ip': 0.09; 'cc:addr:python-list': 0.10; 'wed,': 0.15; 'explicitly': 0.15; "(i'm": 0.16; '100,': 0.16; 'delimit': 0.16; 'ends,': 0.16; 'fiber': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:Accessing': 0.16; 'uncommon': 0.16; 'wing': 0.16; 'wrote:': 0.16; 'byte': 0.18; "shouldn't": 0.18; 'tend': 0.18; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'delay': 0.22; 'text,': 0.22; 'pass': 0.22; 'am,': 0.23; '2015': 0.23; "i've": 0.24; 'header:In-Reply- To:1': 0.24; 'previously': 0.24; 'idea': 0.26; 'message- id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'went': 0.28; '50,': 0.29; 'boundary': 0.29; 'buffers': 0.29; 'dan': 0.29; 'guarantees': 0.29; 'itself,': 0.29; 'protocols': 0.29; 'ray': 0.29; 'sure,': 0.29; 'correct': 0.29; 'that.': 0.30; 'certainly': 0.31; 'fri,': 0.31; 'writes': 0.31; 'system,': 0.32; 'though,': 0.32; 'though.': 0.33; 'received:google.com': 0.34; 'could': 0.35; 'protocol': 0.35; 'problem.': 0.35; 'but': 0.36; 'there': 0.36; 'possible': 0.36; '(and': 0.36; 'client': 0.37; 'subject:: ': 0.37; 'rather': 0.38; 'stuff': 0.38; 'end': 0.39; 'pm,': 0.39; 'does': 0.39; 'seem': 0.39; 'data': 0.40; 'subject:with': 0.40; 'some': 0.40; 'your': 0.60; 'even': 0.61; 'more': 0.62; 'reverse': 0.66; 'receive': 0.71; '100': 0.79; 'william': 0.79; 'chrisa': 0.84; 'dial-up': 0.84; 'entity.': 0.84; 'together,': 0.84; 'to:none': 0.90; '1500': 0.91; 'fragment': 0.91; 'subject:Server': 0.91; 'anywhere,': 0.93; 'instrument': 0.95
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:content-transfer-encoding; bh=rTP9MD2eG4NuPSxOitqcjO5LBLZ3A9PMGNvf3HNTlG8=; b=BY4uqS0CDCyQdtHr63DAdfvgB/sLdDbzFXFe3Jk1iOlKLEsVdlf9fcnU5ZMVvRqiLX XJ5HsJE1G6rszsQwxRhknn0NUcVAYYOAQKh2UIHIVMdbvo8AWsgQoeeYTvpIRk9rRaB7 zGxyUGzGm/Wwb0wQPV7qJRTxb4Gsj0JPCkOnNEHet73R23cwmd2AI7AcnYr/kZvjggkB V8fmXCZ+t8VIF42lBjIo6WC3zXc4j5hhims+NFfQuhCsIiwaaAXZRA1iqzkv0ZE2CaPF Aeo8aREJkE5SeONKbZkM4VcswkG1ySh2M8EdFR1LII1lEZm81+BYz/eMAWwX3SErsckz lL0Q==
MIME-Version 1.0
X-Received by 10.50.61.229 with SMTP id t5mr4501666igr.34.1432910795615; Fri, 29 May 2015 07:46:35 -0700 (PDT)
In-Reply-To <BA77FC3C-223E-4503-AA51-FED9842A5324@mac.com>
References <CAO2fJ-+UjZNqo2yQRRkuSsEJwFAGOnbB9JPCCWX7zX7jt_5POg@mail.gmail.com> <CAGGBd_pEf0E6skDgzVuWLsPEX73OvpTkQ=CwgjKF6Yz+fC6bsw@mail.gmail.com> <BA77FC3C-223E-4503-AA51-FED9842A5324@mac.com>
Date Sat, 30 May 2015 00:46:35 +1000
Subject Re: Accessing DataSocket Server with Python
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
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.184.1432910804.5151.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432910804 news.xs4all.nl 2852 [2001:888:2000:d::a6]:48680
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91461

Show key headers only | View raw


On Fri, May 29, 2015 at 11:37 PM, William Ray Wing <wrw@mac.com> wrote:
>> On May 28, 2015, at 6:17 PM, Dan Stromberg <drsalists@gmail.com> wrote:
>>
>> I have no idea about the protocol used by NI DataSockets, but you
>> might be able to reverse engineer the protocol by using the official
>> client with a sniffer.
>>
>> Also, be aware that TCP/IP guarantees that you get the correct data in
>> the correct order, but it doesn't guarantee anything about the sizes
>> of the chunks in which that data arrives.  So you could send 100
>> bytes, 100 bytes, 100 bytes, but on the other end receive 100 bytes,
>> 50 bytes, 75 bytes, 75 bytes.  When you catenate them all together,
>> it's still the same data though.
>>
>> HTH.
>>
>> On Wed, May 27, 2015 at 4:30 AM, Garrone, Corrado
>
> While that’s certainly possible in a routed network (and even then can be overridden with the “do not fragment” bit), it won’t happen in a LAN or self-contained instrument set-up.  These days, even routed networks tend to deliver anything less than a 1500 byte packet as a single entity.  With fiber backbones and high-speed LANs, it is more work for a router to fragment a packet then to simply pass it on.  The days of 480 byte packets pretty much went away with dial-up modems.
>

It's uncommon to receive 100, 50, 75, 75, to be sure, but it's
certainly possible for multiple writes to be gathered together into
single reads; there are buffers at both ends, and if there's any delay
anywhere, stuff can get combined while it's waiting. (Even stuff that
had previously been sent out as multiple packets, if the data has to
be re-sent, might get grouped.) So you still need to consider your
protocol to be a stream, and delimit messages explicitly rather than
depending on the length of a socket-read. Most of these kinds of
protocols seem to have some kind of message boundary system, though,
so this shouldn't be a problem. (I'm not familiar with DataSocket
itself, but I've used several others that are like that. Even
venerable TELNET effectively does - a "message" is a line of text, so
it's delimited by newline.)

ChrisA

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


Thread

Re: Accessing DataSocket Server with Python Chris Angelico <rosuav@gmail.com> - 2015-05-30 00:46 +1000

csiph-web