Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
2004-04-09 Martin Quinson <martin.quinson@tuxfamily.org>
[simgrid.git] / testsuite / gras / trp_file_client.c
1 /* $Id$ */
2
3 /* trp_tcp_client: Client of a test case for the tcp transport.             */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2003 the OURAGAN project.                                  */
7
8 /* This program is free software; you can redistribute it and/or modify it
9    under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #include <stdio.h>
12 #include <gras.h>
13 #include "../Transport/transport_interface.h"
14
15 //GRAS_LOG_NEW_DEFAULT_CATEGORY(test);
16
17 int main(int argc,char *argv[]) {
18   gras_socket_t * sock;
19   gras_error_t errcode;
20   char data_send[256];
21
22   gras_init_defaultlog(argc,argv,"trp.thresh=debug");
23
24   fprintf(stderr,"===[CLIENT]=== Contact the server\n");
25   TRYFAIL(gras_socket_client_from_file("-",&sock));
26
27   sprintf(data_send,"Hello, I am a little test data to send.");
28   fprintf(stderr,"===[CLIENT]=== Send data\n");
29   TRYFAIL(gras_trp_chunk_send(sock,data_send, sizeof(data_send)));
30   
31   fprintf(stderr,"===[CLIENT]=== Exiting successfully\n");
32   gras_socket_close(&sock);
33   return 0;
34 }