3 /* trp_tcp_server: Server of a test case for the tcp transport. */
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
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. */
12 #include "gras/Transport/transport_interface.h"
14 XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Logging for this test");
16 int main(int argc,char *argv[]) {
17 gras_socket_t sock, conn;
21 gras_init(&argc,argv);
23 fprintf(stderr,"===[SERVER]=== Create the socket\n");
24 TRYFAIL(gras_socket_server_from_file("-",&sock));
26 fprintf(stderr,"===[SERVER]=== Waiting for incomming connexions\n");
27 TRYFAIL(gras_trp_select(60,&conn));
29 fprintf(stderr,"===[SERVER]=== Contacted ! Waiting for the data\n");
30 TRYFAIL(gras_trp_chunk_recv(conn,data_recv, sizeof(data_recv)));
31 fprintf(stderr,"===[SERVER]=== Got '%s'.\n", data_recv);
33 fprintf(stderr,"===[SERVER]=== Exiting successfully\n");
34 gras_socket_close(sock);