On 2013-02-12 02:20, Chris Angelico wrote:
On Tue, Feb 12, 2013 at 12:41 PM, Ihsan Junaidi Ibrahim wrote:
On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote:
On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote:
I probably wouldn't make it fixed length. I'd have the length in
decimal followed by,
In article ,
Ihsan Junaidi Ibrahim wrote:
> I'm running JSON for my application messaging protocol but with JSON and
> python default unordered dict,
> there's no guarantee if I put in the length key in the JSON message, it will
> be placed on the first bytes hence
> why it was designed for a
On Tue, Feb 12, 2013 at 12:41 PM, Ihsan Junaidi Ibrahim wrote:
>
> On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote:
>
>> On Tue, Feb 12, 2013 at 2:11 AM, MRAB wrote:
>>> I probably wouldn't make it fixed length. I'd have the length in
>>> decimal followed by, say, "\n".
>>
>> Or even "followe
On Feb 11, 2013, at 11:24 PM, Chris Angelico wrote:
> On Tue, Feb 12, 2013 at 2:11 AM, MRAB 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-digi
On 02/11/2013 10:02 AM, Ihsan Junaidi Ibrahim wrote:
print 'message length is {0}'.format(nbuf)
while True:
buf = sock.recv(nbuf)
if not buf:
break
This loop doesn't terminate till buf is zero length, which it will be
eventually. At that point,
On Tue, Feb 12, 2013 at 2:11 AM, MRAB 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
On 2013-02-11 14:56, Ihsan Junaidi Ibrahim wrote:
Hi Roy,
On Feb 11, 2013, at 10:24 AM, Roy Smith wrote:
Is this server that you're talking to something that you have control
over, i.e. are you stuck with this protocol? Given a choice, I'd go
with something like JSON, for which pre-existing
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",
"
Hi Dave,
On Feb 11, 2013, at 9:22 AM, Dave Angel wrote:
> Exactly how are you sending "hexadecimal" ? If that 0xad (which is only one
> byte, what about the other 3 ?) is intended to be a C description, then it's
> certainly not hex, it's binary. And probably little-endian, to boot. That's
Hi Roy,
On Feb 11, 2013, at 10:24 AM, Roy Smith wrote:
>
> Is this server that you're talking to something that you have control
> over, i.e. are you stuck with this protocol? Given a choice, I'd go
> with something like JSON, for which pre-existing libraries for every
> language under the s
In article ,
Ihsan Junaidi Ibrahim wrote:
> I'm implementing a python client connecting to a C-backend server and am
> currently stuck to as to how to proceed with receiving variable-length byte
> stream coming in from the server.
>
> I have coded the first 4 bytes (in hexadecimal) of message
On 2013-02-11 00:48, Ihsan Junaidi Ibrahim wrote:
Hi,
I'm implementing a python client connecting to a C-backend server and am
currently stuck to as to how to proceed with receiving variable-length byte
stream coming in from the server.
I have coded the first 4 bytes (in hexadecimal) of messa
On 02/10/2013 07:48 PM, Ihsan Junaidi Ibrahim wrote:
Hi,
I'm implementing a python client connecting to a C-backend server and am
currently stuck to as to how to proceed with receiving variable-length byte
stream coming in from the server.
I have coded the first 4 bytes (in hexadecimal) of me
13 matches
Mail list logo