Help for this page

Select Code to Download


  1. or download this
    use IO::Select;
    my $sock_read_hdl = IO::Select->new();
    ...
    
    # Now we are ready to read message. Note: $read_ready->[0] == $oSocket
    + here.
    eval { ... } or die $@; # As pointed out by ikegami, thanks.
    
  2. or download this
    sub read_msg {
        my ($sock, $bcount, $buf, $msg) = (shift, 0, '', '');
    ...
        # Return success
        return ($msg, $bcount, '');
    }
    
  3. or download this
    ...
    
    ...
    die "Nothing received!\n" if ($bcount == 0);
    
    ...