#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <stdbool.h>
int main(int argc, char **argv)
{
exit(1);
}
- msg_len = read(sock6, buf, 1024);
+ while(true) {
+ msg_len = read(sock6, buf, 1024);
- if (msg_len == -1) {
- perror("receiving data");
- exit(1);
- }
+ if (msg_len == -1) {
+ perror("receiving data");
+ exit(1);
+ }
- buf[msg_len] = '\0';
+ buf[msg_len] = '\0';
+
+ printf("--> %s\n", buf);
+ }
- printf("--> %s\n", buf);
close(sock6);
return 0;
}