1. Joseph Bane
  2. FFS Pixmap visualization client

Commits

Joseph Bane  committed e6e5974

Fixed send.

  • Participants
  • Parent commits 6d4b240
  • Branches default

Comments (0)

Files changed (1)

File client.cpp

View file
     int chars_recv;
 
     /* Receive from server */
-    chars_recv = recv(connect_socket, (char*) Data, len, 0);
+    int bytes_recv = 0;
+    while (bytes_recv < len) {
+      int result = recv(connect_socket, (char*) (Data + bytes_recv), len, 0);
+      bytes_recv += result;
+    }
+/*
     if (chars_recv == -1 || chars_recv == 0) {
         perror("Client: recv data");
         return 0;
         fprintf(stderr, "Client: only received %d out of %d chars\n", chars_recv, len);
         return 0;
     }
+*/
     return 1;
 }