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


Groups > comp.lang.python > #38695

Re: Python recv loop

References <mailman.1612.1360544258.2939.python-list@python.org> <roy-CC4632.21243210022013@news.panix.com> <E4DA0A42-324E-43D0-A366-21267C538D5D@grep.my> <51190A32.7070105@mrabarnett.plus.com>
Date 2013-02-12 02:24 +1100
Subject Re: Python recv loop
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1660.1360596251.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Feb 12, 2013 at 2:11 AM, MRAB <python@mrabarnett.plus.com> wrote:
> I probably wouldn't make it fixed length. I'd have the length in
> decimal followed by, say, "\n".

Or even "followed by any non-digit". Chances are your JSON data begins
with a non-digit, so you'd just have to insert a space in the event
that you're JSON-encoding a flat integer. (Which might not ever
happen, if you know that your data will always be an object.)

ChrisA

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


Thread

Python recv loop Ihsan Junaidi Ibrahim <ihsan@grep.my> - 2013-02-11 08:48 +0800
  Re: Python recv loop Roy Smith <roy@panix.com> - 2013-02-10 21:24 -0500
    Re: Python recv loop Ihsan Junaidi Ibrahim <ihsan@grep.my> - 2013-02-11 22:56 +0800
      Re: Python recv loop Roy Smith <roy@panix.com> - 2013-02-11 21:44 -0500
    Re: Python recv loop MRAB <python@mrabarnett.plus.com> - 2013-02-11 15:11 +0000
    Re: Python recv loop Chris Angelico <rosuav@gmail.com> - 2013-02-12 02:24 +1100
    Re: Python recv loop Ihsan Junaidi Ibrahim <ihsan@grep.my> - 2013-02-12 09:41 +0800
    Re: Python recv loop Chris Angelico <rosuav@gmail.com> - 2013-02-12 13:20 +1100
    Re: Python recv loop MRAB <python@mrabarnett.plus.com> - 2013-02-12 03:09 +0000

csiph-web