aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2017-11-08 13:41:12 -0500
committerTucker Evans <tuckerevans24@gmail.com>2017-11-08 13:41:12 -0500
commit364af430e7a11a2482eda6b042b56eccba14beb1 (patch)
treedaca7ff46a1f352eb1c0ff7cbed8749932b46c7b
parentfb3fa5cde6ed4da2eb6453007ab9d935cc438806 (diff)
CS3871/assignments/timing: Fixed issue with select and NULL ww
-rw-r--r--timing/client.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/timing/client.c b/timing/client.c
index 8382600..9a83a5b 100644
--- a/timing/client.c
+++ b/timing/client.c
@@ -55,6 +55,9 @@ char **argv;
sock = sock_init(argv);
+ ww = NULL;
+
+ printf("Connected, waiting for numbers...\n");
while (1) {
FD_ZERO(&rs); FD_ZERO(&ws); FD_ZERO(&es);
FD_SET(sock, &rs);
@@ -75,7 +78,7 @@ char **argv;
end_ptr = 0;
if (end_ptr != start_ptr) {
gettimeofday(&(num_buffer[end_ptr].tv), NULL);
- num_buffer[end_ptr].val = atoi(buffer);
+ num_buffer[end_ptr].val = atoi(buffer + i);
end_ptr++;
} else {
printf("dropping number...\n");
@@ -93,6 +96,12 @@ char **argv;
}
} else {
for (i = start_ptr; i < BUFFER_SIZE; i++) {
+ num_buffer[end_ptr].val = atoi(buffer);
+ end_ptr++;
+ num_buffer[end_ptr].val = atoi(buffer);
+ end_ptr++;
+ num_buffer[end_ptr].val = atoi(buffer);
+ end_ptr++;
if (num_buffer[i].tv.tv_sec <= now.tv_sec)
start_ptr = i + 1;
}