LISTEN()

this is used on the server-side to cause a TCP socket to listen for new connections

    // 3. listen() - Listen for incoming connections
    if (listen(server_socket, 5) < 0) {
        perror("listen");
        close(server_socket);
        exit(EXIT_FAILURE);
    }

Last updated