http://www.perlmonks.org?node_id=256189


in reply to Re: Error message in log file is different from "die" message in code.
in thread Error message in log file is different from "die" message in code.

This is how $ready_socket created.
527>($r_ready, $w_ready, $e_ready) = IO::Select->select($read_set, $wr +ite_set, undef, 10); 528> foreach my $ready_socket (@$r_ready) { 529> if( $ready_socket==$server ) { # Incomming connection 530> warn "Server socket ready, accepting..."; 531> my $new_connection=$server->accept(); 532> # make the socket non-blocking 533> my $flags = fcntl($new_connection, F_GETFL, 0) 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";
$server is created like this earlier.
my $server = IO::Socket::INET->new(LocalPort => $cfg->server_port, Type => SOCK_STREAM, Reuse => 1, Listen => 10, ) or die "could not become a tcp server on port ", $cfg->server_port, +" : $@\n";

Replies are listed 'Best First'.
Re^3: Error message in log file is different from "die" message in code. (barked up the wrong tree..)
by Aristotle (Chancellor) on May 07, 2003 at 14:25 UTC
    That seems to be correct after some study of those modules' POD. The fact remains that $server->accept() is returning undef for failure - whatever the reason may be. Is there actually an external connection request at that point?

    Makeshifts last the longest.