- int dummy=1234;
- gras_msg_t *msg;
- gras_error_t errcode;
- client_data_t *g=gras_userdata_new(client_data_t);
-
- if ((errcode=gras_sock_client_open("102",4000,&(g->sock)))) {
- fprintf(stderr,"Client: Unable to connect to the server. Got %s\n",
- gras_error_name(errcode));
+ xbt_error_t errcode;
+ client_data_t *g;
+
+ gras_socket_t from;
+ int ping, pong;
+
+ const char *host = "127.0.0.1";
+ int port = 4000;
+
+ gras_init(&argc, argv, NULL);
+ g=gras_userdata_new(client_data_t);
+
+ if (argc == 3) {
+ host=argv[1];
+ port=atoi(argv[2]);
+ }
+
+ INFO2("Launch client (server on %s:%d)",host,port);
+ gras_os_sleep(1,0); /* Wait for the server startup */
+ if ((errcode=gras_socket_client(host,port,&(g->sock)))) {
+ ERROR1("Client: Unable to connect to the server. Got %s",
+ xbt_error_name(errcode));