updated test clients/servers

This commit is contained in:
Joseph Henry
2016-08-11 23:30:58 -07:00
parent 575670a59c
commit c0a89129fa
2 changed files with 90 additions and 75 deletions

View File

@@ -49,17 +49,19 @@ int main(int argc , char *argv[])
// RX
int msglen = 1024;
unsigned long count = 0;
while(1)
{
count++;
int bytes_read = read(client_sock, client_message, msglen);
printf("RX = (%d): ", bytes_read);
printf("[%lu] RX = (%d): ", count, bytes_read);
for(int i=0; i<bytes_read; i++) {
printf("%c", client_message[i]);
}
// TX
int bytes_written = write(client_sock, "Server here!", msglen);
printf("\nTX = %d\n", bytes_written);
int bytes_written = write(client_sock, "Server here!", 12);
printf("\t\nTX = %d\n", bytes_written);
}
return 0;
}