File: client.ml

package info (click to toggle)
camlrpc 0.4.5-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,092 kB
  • ctags: 1,494
  • sloc: ml: 11,933; makefile: 599; sh: 345; ansic: 331
file content (31 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
open Rtypes
open Xdr
open Rpc
open Procdef

let serverhost = "localhost";;
  (* where the server runs *)


let port =
  lazy (Rpc_portmapper.port_of_program program serverhost Tcp)
;;


let call name v =
  let c =
    Rpc_simple_client.create 
      (Rpc_client.Inet (serverhost, Lazy.force port))
      Tcp
      program 
  in
  let result = Rpc_simple_client.call c name v in
  Rpc_simple_client.shut_down c;
  result
;;


let plus1 = call "plus1";;
let sortarray = call "sortarray";;
let sortlist = call "sortlist";;