Help for this page

Select Code to Download


  1. or download this
    527>($r_ready, $w_ready, $e_ready) = IO::Select->select($read_set, $wr
    +ite_set, undef, 10);
    528>    foreach my $ready_socket (@$r_ready) {
    ...
    534>           or die "cannot get flags for socket: $!\n";
    535>        $flags = fcntl($new_connection, F_SETFL, $flags | O_NONBLO
    +CK)
    536>           or die "cannot set flags for socket: $!\n";
    
  2. or download this
    my $server = IO::Socket::INET->new(LocalPort => $cfg->server_port,
                       Type      => SOCK_STREAM,
    ...
                       Listen    => 10,
                      )
      or die "could not become a tcp server on port ", $cfg->server_port, 
    +" : $@\n";