diff --git a/c/pong.c b/c/pong.c index 578aa0a..fb0e569 100644 --- a/c/pong.c +++ b/c/pong.c @@ -26,6 +26,7 @@ int main(void) { char event_type; size_t index = 0; int originfd = 0; + int newfd = 0; void *ctx = NULL; printf ("Init context.\n"); @@ -58,7 +59,7 @@ int main(void) { size_t count = 0; while(should_continue) { size = MAX_MSG_SIZE; - ret = ipc_wait_event (ctx, &event_type, &index, &originfd, message, &size); + ret = ipc_wait_event (ctx, &event_type, &index, &originfd, &newfd, message, &size); if (ret != 0) { return err(ctx, "Error while waiting for an event."); } diff --git a/c/pongd.c b/c/pongd.c index ddb64ba..5ef296d 100644 --- a/c/pongd.c +++ b/c/pongd.c @@ -23,6 +23,7 @@ int main(int argc, char**argv) { char event_type; size_t index = 0; int originfd = 0; + int newfd = 0; void *ctx = NULL; int max_count = 0; @@ -56,7 +57,7 @@ int main(int argc, char**argv) { size_t count_timer = 0; while(should_continue) { size = MAX_MSG_SIZE; - ret = ipc_wait_event (ctx, &event_type, &index, &originfd, message, &size); + ret = ipc_wait_event (ctx, &event_type, &index, &originfd, &newfd, message, &size); if (ret != 0) { return err (ctx, "Error while waiting for an event."); } @@ -70,7 +71,7 @@ int main(int argc, char**argv) { case EXTERNAL: return err(ctx, "External (shouldn't happen)."); case SWITCH_RX: return err(ctx, "Switch RX (shouldn't happen)."); case SWITCH_TX: return err(ctx, "Switch TX (shouldn't happen)."); - case CONNECTION: { printf ("New connection.\n"); break; } + case CONNECTION: { printf ("New connection (%d).\n", newfd); break; } case DISCONNECTION: { printf ("User disconnected.\n"); break; } case TIMER: {