Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove this useless select since windows cannot select on files handles, only on...
[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 #include <stdio.h>
11 #include "gras.h"
12 #include "gras/Transport/transport_interface.h"
13
14 XBT_LOG_NEW_CATEGORY(test,"Logging for this test");
15
16 int main(int argc,char *argv[]) {
17   gras_socket_t sock;
18   char data_send[256];
19
20   memset(data_send,0,sizeof(data_send));
21   gras_init(&argc,argv);
22
23   fprintf(stderr,"===[CLIENT]=== Contact the server\n");
24   sock = gras_socket_client_from_file("-");
25
26   sprintf(data_send,"Hello, I am a little test data to send.");
27   fprintf(stderr,"===[CLIENT]=== Send data\n");
28   gras_trp_send(sock,data_send, sizeof(data_send),1);
29   
30   fprintf(stderr,"===[CLIENT]=== Exiting successfully\n");
31   gras_socket_close(sock);
32    
33   gras_exit();
34   return 0;
35 }