FCNTL()

this is a berkeley socket version used to get and set some socket options

    // 8. fcntl() - Set socket to non-blocking mode (POSIX)
    int flags = fcntl(server_socket, F_GETFL, 0);
    if (flags < 0 || fcntl(server_socket, F_SETFL, flags | O_NONBLOCK) < 0) {
        perror("fcntl");
    }

Last updated