the code is not supposed to block waiting for input from a particular client or the listening socket, but when i run it, it waits for the first client to enter a username before accepting the second client. The line //handles client input is just a comment that does not aafect this.
int main() {
    initialize_socket();
    printf("Server listening on port %d\n", PORT);

    User *user_list = NULL;
    Client *actives = NULL;

    int max_fd = listen_soc;
    printf("list soc max_fd %d", max_fd);
    fd_set all_fds;
    FD_ZERO(&all_fds);
    FD_SET(listen_soc, &all_fds);

    while (1) {
        fd_set listen_fds = all_fds;
        int nready = select(max_fd + 1, &listen_fds, NULL, NULL, NULL);
        if (nready == -1) {
            perror("server: select");
            exit(1);
        }

        if (FD_ISSET(listen_soc, &listen_fds)) {
            struct sockaddr_in client_address;
            socklen_t client_address_len = sizeof(client_address);

            int client_fd = accept(listen_soc, (struct sockaddr *)&client_address, &client_address_len);
            if (client_fd < 0) {
                perror("accept");
                continue;
            }

            // Prompt the client for their name
            char name_buffer[BUFFER_SIZE + 1];
            check_user(name_buffer, client_fd, user_list);

            // Create a new user with the given name
            create_user(name_buffer, &user_list);
            User *new_user = find_user(name_buffer, user_list);

            // create new client and add to list of active clients
            Client *new_client = malloc(sizeof(Client));
            new_client->fd = client_fd;
            new_client->name = new_user->name;
            new_client->input_len = 0;
            new_client->next = actives;
            actives = new_client;

            // Add the new client's socket to the file descriptor set for select
            FD_SET(client_fd, &all_fds);
            if (client_fd > max_fd) {
                max_fd = client_fd;
            }
            printf("updated max_fd %d", max_fd);
            printf("Accepted connection\n");

            char welcome_message[BUFFER_SIZE];
            snprintf(welcome_message, BUFFER_SIZE, "Welcome, %s! Go ahead and enter user commands>\r\n", new_user->name);
            write(client_fd, welcome_message, strlen(welcome_message));
        }
        for (Client *client = actives; client != NULL; client = client->next) {
            if (FD_ISSET(client->fd, &listen_fds)) {
                // Read input from client
                // handle client input 
            }
        }
    }

    return 0;
}
