Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Flush the socket after write
[simgrid.git] / testsuite / gras / trp_tcp_client.c
index 5eb465f..fa6a09b 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <stdio.h>
 #include <gras.h>
-#include "../Transport/transport_interface.h"
+#include "gras/Transport/transport_interface.h"
 
 //GRAS_LOG_NEW_DEFAULT_CATEGORY(test);
 
@@ -31,12 +31,13 @@ int main(int argc,char *argv[]) {
   sprintf(data_send,"Hello, I am a little test data to send.");
   fprintf(stderr,"===[CLIENT]=== Send data\n");
   TRYFAIL(gras_trp_chunk_send(sock,data_send, sizeof(data_send)));
+  TRYFAIL(gras_trp_flush(sock));
   fprintf(stderr,"===[CLIENT]=== Waiting for the ACK\n");
   TRYFAIL(gras_trp_chunk_recv(sock,data_recv, sizeof(data_recv)));
   
   if (strcmp(data_send, data_recv)) {
     fprintf(stderr, "===[CLIENT]=== String sent != string received\n");
-    exit(1);
+    gras_abort();
   } 
   fprintf(stderr,"===[CLIENT]=== Got a valid ACK\n");