On Sunday, 19 July 2009 03:03:48 UTC+5:30, twgray wrote:
> I am attempting to send a jpeg image file created on an embedded
> device over a wifi socket to a Python client running on a Linux pc
> (Ubuntu). All works well, except I don't know, on the pc client side,
> what the file size is? The fo
>> I am interested in seeing your code and would be grateful if you shared it
>> with this list.
> All right here it is. Hope it helps.
Hendrik,
Thank you very much!! (I'm not the OP, but found this thread
interesting)
Best regards,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-li
On Sunday 19 July 2009 15:18:21 pyt...@bdurham.com wrote:
> Hi Hendrik,
> > If anybody is interested I will attach the code here. It is not a big
> > module.
>
> I am interested in seeing your code and would be grateful if you shared
> it with this list.
All right here it is.
Hope it helps
- He
Hi Hendrik,
> I have ended up writing a netstring thingy, that addresses the string
> transfer problem by having a start sentinel, a four byte ASCII length (so you
> can see it with a packet sniffer/displayer) and the rest of the data escaped
> to take out the start sentinel and the escape char
On Sunday 19 July 2009 02:12:32 John Machin wrote:
>
> Apologies in advance for my ignorance -- the last time I dipped my toe
> in that kind of water, protocols like zmodem and Kermit were all the
> rage -- but I would have thought there would have been an off-the-
> shelf library for peer-to-peer
> John Machin (JM) wrote:
>JM> On Jul 19, 7:43 am, Irmen de Jong wrote:
>>> twgray wrote:
>>> > I am attempting to send a jpeg image file created on an embedded
>>> > device over a wifi socket to a Python client running on a Linux pc
>>> > (Ubuntu). All works well, except I don't know, on t
In article ,
MRAB wrote:
>
>If you send the length as 4 bytes then you'll have to decide whether
>it's big-endian or little-endian. An alternative is to send the length
>as characters, terminated by, say, '\n' or chr(0).
Alternatively, make it a fixed-length string of bytes, zero-padded in
front
On Jul 18, 7:33 pm, MRAB wrote:
> Nobody wrote:
> > On Sat, 18 Jul 2009 14:33:48 -0700, twgray wrote:
>
> >> It appears to be locking up in 'data=self.s.recv(MAXPACKETLEN)' on
> >> the final packet, which will always be less than MAXPACKETLEN.
>
> >> I guess my question is, how do I detect end of
Nobody wrote:
On Sat, 18 Jul 2009 14:33:48 -0700, twgray wrote:
It appears to be locking up in 'data=self.s.recv(MAXPACKETLEN)' on
the final packet, which will always be less than MAXPACKETLEN.
I guess my question is, how do I detect end of data on the client side?
recv() should return zero
On Jul 19, 7:43 am, Irmen de Jong wrote:
> twgray wrote:
> > I am attempting to send a jpeg image file created on an embedded
> > device over a wifi socket to a Python client running on a Linux pc
> > (Ubuntu). All works well, except I don't know, on the pc client side,
> > what the file size is?
On Sat, 18 Jul 2009 14:33:48 -0700, twgray wrote:
> It appears to be locking up in 'data=self.s.recv(MAXPACKETLEN)' on
> the final packet, which will always be less than MAXPACKETLEN.
>
> I guess my question is, how do I detect end of data on the client side?
recv() should return zero when the
twgray wrote:
On Jul 18, 4:43 pm, Irmen de Jong wrote:
twgray wrote:
I am attempting to send a jpeg image file created on an embedded
device over a wifi socket to a Python client running on a Linux pc
(Ubuntu). All works well, except I don't know, on the pc client side,
what the file size is?
On Jul 19, 8:04 am, twgray wrote:
> send a 4 byte address from the embedded device, how do I convert that,
> in Python, to a 4 byte, or long, number?
struct.unpack() is your friend. Presuming the embedded device is
little-endian, you do:
the_int = struct.unpack('http://docs.python.org/library/s
On Jul 18, 4:43 pm, Irmen de Jong wrote:
> twgray wrote:
> > I am attempting to send a jpeg image file created on an embedded
> > device over a wifi socket to a Python client running on a Linux pc
> > (Ubuntu). All works well, except I don't know, on the pc client side,
> > what the file size is?
On Sat, Jul 18, 2009 at 4:43 PM, Irmen de Jong wrote:
> twgray wrote:
>>
>> I am attempting to send a jpeg image file created on an embedded
>> device over a wifi socket to a Python client running on a Linux pc
>> (Ubuntu). All works well, except I don't know, on the pc client side,
>> what the fi
twgray wrote:
I am attempting to send a jpeg image file created on an embedded
device over a wifi socket to a Python client running on a Linux pc
(Ubuntu). All works well, except I don't know, on the pc client side,
what the file size is?
You don't. Sockets are just endless streams of bytes.
I am attempting to send a jpeg image file created on an embedded
device over a wifi socket to a Python client running on a Linux pc
(Ubuntu). All works well, except I don't know, on the pc client side,
what the file size is? The following is a snippet:
[code]
f = open("frame.jpg",mode =
17 matches
Mail list logo