Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a directory for all builds
[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 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9  
10 #ifdef __BORLANDC__
11 #pragma hdrstop
12 #endif
13
14 #include <stdio.h>
15 #include "gras.h"
16 #include "gras/Transport/transport_interface.h"
17
18 XBT_LOG_NEW_CATEGORY(test,"Logging for this test");
19
20 #ifdef __BORLANDC__
21 #pragma argsused
22 #endif
23
24 int main(int argc,char *argv[]) {
25   gras_socket_t sock;
26   char data_send[256];
27
28   memset(data_send,0,sizeof(data_send));
29   gras_init(&argc,argv);
30
31   fprintf(stderr,"===[CLIENT]=== Contact the server\n");
32   sock = gras_socket_client_from_file("-");
33
34   sprintf(data_send,"Hello, I am a little test data to send.");
35   fprintf(stderr,"===[CLIENT]=== Send data\n");
36   gras_trp_send(sock,data_send, sizeof(data_send),1);
37   
38   fprintf(stderr,"===[CLIENT]=== Exiting successfully\n");
39   gras_socket_close(sock);
40    
41   gras_exit();
42   return 0;
43 }