Imported from 6.824 labs
[invirt/third/libt4.git] / lock_demo.cc
1 //
2 // Lock demo
3 //
4
5 #include "lock_protocol.h"
6 #include "lock_client.h"
7 #include "rpc.h"
8 #include <arpa/inet.h>
9 #include <vector>
10 #include <stdlib.h>
11 #include <stdio.h>
12
13 std::string dst;
14 lock_client *lc;
15
16 int
17 main(int argc, char *argv[])
18 {
19   int r;
20
21   if(argc != 2){
22     fprintf(stderr, "Usage: %s [host:]port\n", argv[0]);
23     exit(1);
24   }
25
26   dst = argv[1];
27   lc = new lock_client(dst);
28   r = lc->stat(1);
29   printf ("stat returned %d\n", r);
30 }