3 /* trp_tcp_server: Server of a test case for the tcp transport. */
5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2003 the OURAGAN project. */
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. */
13 #include "../Transport/transport_interface.h"
15 //GRAS_LOG_NEW_DEFAULT_CATEGORY(test);
17 int main(int argc,char *argv[]) {
18 gras_socket_t *sock, *conn;
22 gras_init_defaultlog(&argc,argv,"trp.thresh=debug");
24 fprintf(stderr,"===[SERVER]=== Create the socket\n");
25 TRYFAIL(gras_socket_server_from_file("-",&sock));
27 fprintf(stderr,"===[SERVER]=== Waiting for incomming connexions\n");
28 TRYFAIL(gras_trp_select(60,&conn));
30 fprintf(stderr,"===[SERVER]=== Contacted ! Waiting for the data\n");
31 TRYFAIL(gras_trp_chunk_recv(conn,data_recv, sizeof(data_recv)));
32 fprintf(stderr,"===[SERVER]=== Got '%s'.\n", data_recv);
34 fprintf(stderr,"===[SERVER]=== Exiting successfully\n");
35 gras_socket_close(&sock);