Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38692 > unrolled thread
| Started by | Ihsan Junaidi Ibrahim <ihsan@grep.my> |
|---|---|
| First post | 2013-02-11 23:08 +0800 |
| Last post | 2013-02-11 23:08 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python recv loop Ihsan Junaidi Ibrahim <ihsan@grep.my> - 2013-02-11 23:08 +0800
| From | Ihsan Junaidi Ibrahim <ihsan@grep.my> |
|---|---|
| Date | 2013-02-11 23:08 +0800 |
| Subject | Re: Python recv loop |
| Message-ID | <mailman.1657.1360595288.2939.python-list@python.org> |
Hi MRAB,
My code now works thanks to your advice.
{"msgver": "1.0", "msgid": "200", "subcode": "100", "appver": "1.0", "appid": "1.0", "data": {"1": "igb0", "2": "igb1", "ifcnt": "2"}}
connected to misty:8080
sending data
138 bytes sent: 0x86{"msgver": "1.0", "msgid": "200", "subcode": "100", "appver": "1.0", "appid": "1.0", "data": {"1": "igb0", "2": "igb1", "ifcnt": "2"}}
receiving data
message length is 188
188 bytes received: { "msgver": 1.000000, "appver": 1.000000, "appid": 1000, "msgid": 10, "subcode": 20, "data": [ "110.159.183.16", "124.108.16.94", "2400:3700:50::2", "2400:3700:50::1", "2400:3700:51::" ] }
Many thanks.
On Feb 11, 2013, at 9:55 AM, MRAB <python@mrabarnett.plus.com> wrote:
> You should keep reading until you get all need or the connection is
> closed:
>
> buf = b''
> while len(buf) < nbuf:
> chunk = sock.recv(nbuf - len(buf))
>
> if not chunk:
> break
>
> buf += chunk
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Back to top | Article view | comp.lang.python
csiph-web