On 2007-02-08, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
struct module pack and unpack will only work for fixed size buffer :
pack('>1024sIL', buffer, count. offset) but the buffer size can vary
from one packet to the next :-(
>>>
>>> Oh for Pete's sake...
>>>
>>> struct.pack('>%
On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Feb 8, 3:40 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
>> On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> > struct module pack and unpack will only work for fixed size buffer :
>> > pack('>1024sIL', buffer, count.
> Grant had the right idea, I think, but he failed to actually include a
> byte length in his format. :) So there's nothing to peek at. If the
> packing is done like this, instead..
>
>
> struct.pack('!IIL', len(buffer), count, offset) + buffer
>
> Then it is a simple matter to unpack it o
On Thu, 08 Feb 2007 15:56:30 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>[EMAIL PROTECTED] wrote:
>
>> On Feb 8, 3:40 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
>>> On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>
>>> > struct module pack and unpack will only work for fi
[EMAIL PROTECTED] wrote:
> On Feb 8, 3:40 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
>> On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> > struct module pack and unpack will only work for fixed size buffer :
>> > pack('>1024sIL', buffer, count. offset) but the buffer size can va
On Feb 8, 3:40 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > struct module pack and unpack will only work for fixed size buffer :
> > pack('>1024sIL', buffer, count. offset) but the buffer size can vary
> > from one packet to the ne
On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> struct module pack and unpack will only work for fixed size buffer :
> pack('>1024sIL', buffer, count. offset) but the buffer size can vary
> from one packet to the next :-(
Oh for Pete's sake...
struct.pack('>%dsIL' % len(buffer), b
En Thu, 08 Feb 2007 00:14:13 -0300, <[EMAIL PROTECTED]> escribió:
> On Feb 8, 1:43 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>> > I want a specific packet format for packet exchange between a
>> > client server across the network. For example frame format
>> >
On 7 Feb 2007 19:14:13 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> struct module pack and unpack will only work for fixed size buffer :
> pack('>1024sIL', buffer, count. offset) but the buffer size can vary
> from one packet to the next :-(
Then send the size of the buffer before the buffer, s
On Feb 8, 1:43 am, Bjoern Schliessmann wrote:
> [EMAIL PROTECTED] wrote:
> > I want a specific packet format for packet exchange between a
> > client server across the network. For example frame format
> > as a python class could be:
> > class Frame:
> > def __init__(self, buffer=None, cou
[EMAIL PROTECTED] wrote:
> I want a specific packet format for packet exchange between a
> client server across the network. For example frame format
> as a python class could be:
> class Frame:
> def __init__(self, buffer=None, count=0, offset=0):
> self.buffer = buffer
>
I want a specific packet format for packet exchange between a client
server across the network. For example frame format
as a python class could be:
class Frame:
def __init__(self, buffer=None, count=0, offset=0):
self.buffer = buffer
self.count = count
12 matches
Mail list logo