Hi,
Pedro Côrte-Real:
> I'm truncating using the length I assumed the offset didn't actually
> do anything. My Ruby code is translated from the python one and that
> one didn't do anything with it.
That may be because the Python code is not actually written well. :-/
Apart from the non-handling of the offset, there's the broken
assumption that read()ing the header always returns 24 bytes,
the non-existence of any sort of either keepalive or timeout,
the inability to use persistent connections, and also the style
issue of writing
val = struct.unpack("iiiiii",data)
foo = socket.ntohl(val[0])
bar = socket.ntohl(val[1])
[...]
which is expressible *way* more succinctly as
foo,bar,baz,quux,what,ever = struct.unpack("!6i",data)
I've been writing my own Python client, based on the Twisted framework.
(No time to finish it, unfortunately. :-( )
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | [EMAIL PROTECTED]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
Time and tide wait for no one.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers