From: Philippe Strauss <philou@philou.ch>
To: caml-list@inria.fr
Subject: Re: [Caml-list] rpc: type conversion
Date: Fri, 05 Nov 2010 00:15:33 +0100 [thread overview]
Message-ID: <4CD33E95.4010901@philou.ch> (raw)
In-Reply-To: <4CD32508.6080102@philou.ch>
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
next prev parent reply other threads:[~2010-11-04 23:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 21:26 Philippe Strauss
2010-11-04 23:15 ` Philippe Strauss [this message]
2010-11-05 1:02 ` [Caml-list] " Gerd Stolpmann
2010-11-05 16:52 ` Jake Donham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CD33E95.4010901@philou.ch \
--to=philou@philou.ch \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox