Skip to content
Snippets Groups Projects
Commit a620b647 authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Actually use threading instead of single thread

parent eccad460
Branches
No related merge requests found
...@@ -187,7 +187,7 @@ int main(int argc, char* argv[]) { ...@@ -187,7 +187,7 @@ int main(int argc, char* argv[]) {
// A connection has been established. Open new thread. // A connection has been established. Open new thread.
char* ip = inet_ntoa(client_address->sin_addr); char* ip = inet_ntoa(client_address->sin_addr);
printf("Client IP: %s Conn FD: %d\n", ip, *conn_fd); 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. // Check if any threads have finished. If so, join.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment