From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 4F5A2BC57 for ; Fri, 5 Nov 2010 00:15:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AngFAMvb0kw+3JIE/2dsb2JhbACTOjGOBHG+KoVGBIpV X-IronPort-AV: E=Sophos;i="4.58,298,1286143200"; d="scan'208";a="64986133" Received: from vs.philou.ch ([62.220.146.4]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Nov 2010 00:15:34 +0100 Received: from air.lan (85-218-16-6.dclient.lsne.ch [85.218.16.6]) by vs.philou.ch (Postfix) with ESMTPSA id 0B6481F2A489 for ; Fri, 5 Nov 2010 00:20:50 +0100 (CET) Message-ID: <4CD33E95.4010901@philou.ch> Date: Fri, 05 Nov 2010 00:15:33 +0100 From: Philippe Strauss User-Agent: Postbox 2.0.2 (Macintosh/20101025) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] rpc: type conversion References: <4CD32508.6080102@philou.ch> In-Reply-To: <4CD32508.6080102@philou.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lacks:01 lacks:01 beginner's:01 ocaml:01 bug:01 srv:98 3333:98 beginners:01 wrote:01 caml-list:01 caml-list:01 oops:01 int:01 int:01 bin:01 oops, Rtypes.int_of_int4 and int4_of_int. sorry. Philippe Strauss wrote: > Hello, > > I need to use RPC in a current project of mine, but I don't get how do > you write the type conversion and what is provided, taking a very > basic example: > > --8<-- > program Rpc_control { > version V1 { > int add(int, int) = 1; > } = 1; > } = 0x2000007f; > --8<-- > > and the server code: > > --8<-- > let add arg = > match arg with > | (a, b) -> a + b > | _ -> 0 > > let _ = > let esys = Unixqueue.standard_event_system () in > let server = Deconv_srv.Rpc_control.V1.create_server ~proc_add: add > (Rpc_server.Localhost 3333) Rpc.Tcp Rpc.Socket esys in > Unixqueue.run esys > --8<-- > > my add fun is wrong regarding the types, I've read about type > conversion but the doco lacks examples, the examples lacks basic use > of int <-> Rtype.int4. > > > Thanks > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs