[sugar] Data Transport between nodes

Benjamin M. Schwartz bmschwar
Tue Oct 2 17:43:41 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Erik Blankinship wrote:
> How would you change the HelloMesh example to send binary data or an
> object?  Could you post a diff?  That would be useful for a reference. 
> Thanks!

This is a dangerous suggestion, but you may want to look at the source code for
my Acoustic Measure activity:
http://dev.laptop.org/git?p=projects/acoustic-measure-activity;a=summary

My code is directly based on HelloMesh, but I needed to send binary data over
the Tube.  The answer to your question specifically is basically one word:
base64.  Python has a base64 module providing b64encode and b64decode functions.
 I used these to send arbitrary bytes over the Tube, which only supports utf8.

- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHAruNUJT6e6HFtqQRApvnAJ9BXUNNJqXlms2rmnTJZdwvrP1/1ACeL2fB
HPTNyqfd/3qkCqqJy0ZfnZo=
=iuF6
-----END PGP SIGNATURE-----



More information about the Sugar-devel mailing list