############################################################################### # # _nonblock - given a socket, make it non-blocking # ############################################################################### sub _nonblock { my $self = shift; my $socket = shift; my $flags = fcntl($socket, F_GETFL, 0) or croak("Can't get flags for socket: $!\n"); fcntl($socket, F_SETFL, $flags | O_NONBLOCK) or croak("Can't make socket nonblocking: $!\n"); }