diff --git a/Main.c b/Main.c index 4f4bf7631f9f19921925a60ad9641b7ea7a660a4..83cdf989537589e4e6c1e3fa6af29be88a1147ce 100644 --- a/Main.c +++ b/Main.c @@ -187,7 +187,7 @@ int main(int argc, char* argv[]) { // A connection has been established. Open new thread. char* ip = inet_ntoa(client_address->sin_addr); printf("Client IP: %s Conn FD: %d\n", ip, *conn_fd); - pthread_create(&thread_array[0], &attr, serve_request, (void*) &((struct conn_obj) {copy_int(&index), conn_fd, client_address})); + pthread_create(&thread_array[index], &attr, serve_request, (void*) &((struct conn_obj) {copy_int(&index), conn_fd, client_address})); } // Check if any threads have finished. If so, join.