caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] serialize/deserialize
@ 2002-07-19  6:18 Brian Naylor
  2002-07-19 14:51 ` Michael Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Naylor @ 2002-07-19  6:18 UTC (permalink / raw)
  To: caml-list

I need to write my own marshalling functions for a network protocol stack. Is
there any way I can make use of the <caml/intext.h> serialization and
deserialization functions? Has anyone trod this path before me and is willing
to share their wisdom?

Why am I doing this, you ask? Bandwidth is critical, and custom marshalling can
save a lot of space - especially in getting rid of headers. Also, I want to do
things like serialize some info, add a MAC, then serialize some more. The
off-the-shelf solution is too space-inefficient:

let alen = Marshal.to_buffer buf ofs max adata [] in
let mac = Digest.substring buf ofs alen in
let blen = Marshal.to_buffer buf (ofs + alen) (max - alen) (mac, bdata) [] in
...

Thanks for any advice...

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-20 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-19  6:18 [Caml-list] serialize/deserialize Brian Naylor
2002-07-19 14:51 ` Michael Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).