From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA26005; Fri, 19 Jul 2002 08:18:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA26001 for ; Fri, 19 Jul 2002 08:18:39 +0200 (MET DST) Received: from web13406.mail.yahoo.com (web13406.mail.yahoo.com [216.136.175.64]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g6J6Ic127299 for ; Fri, 19 Jul 2002 08:18:38 +0200 (MET DST) Message-ID: <20020719061837.10716.qmail@web13406.mail.yahoo.com> Received: from [63.195.80.23] by web13406.mail.yahoo.com via HTTP; Thu, 18 Jul 2002 23:18:37 PDT Date: Thu, 18 Jul 2002 23:18:37 -0700 (PDT) From: Brian Naylor Subject: [Caml-list] serialize/deserialize To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I need to write my own marshalling functions for a network protocol stack. Is there any way I can make use of the 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