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 0E1E3BC57 for ; Thu, 4 Nov 2010 22:26:34 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncFAALC0kw+3JIE/2dsb2JhbACTbo4Ecb5AhUYEilU X-IronPort-AV: E=Sophos;i="4.58,298,1286143200"; d="scan'208";a="64968554" Received: from vs.philou.ch ([62.220.146.4]) by mail3-smtp-sop.national.inria.fr with ESMTP; 04 Nov 2010 22:26: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 21BAE1F2A49E for ; Thu, 4 Nov 2010 22:31:49 +0100 (CET) Message-ID: <4CD32508.6080102@philou.ch> Date: Thu, 04 Nov 2010 22:26:32 +0100 From: Philippe Strauss User-Agent: Postbox 2.0.2 (Macintosh/20101025) MIME-Version: 1.0 To: caml-list@inria.fr Subject: rpc: type conversion Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lacks:01 lacks:01 srv:98 3333:98 int:01 int:01 match:02 arg:03 arg:03 let:03 let:03 types:05 examples:07 examples:07 standard:07 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