Subject: | bind() failure in new() not reported for non-blocking sockets |
When trying to bind a socket with new() in non-blocking mode this is not a fatal error, but it should be:
perl -MIO::Socket::IP -le 'push @a, IO::Socket::IP->new(LocalPort => 2345, Blocking =>0) || die "Fail: $@" for 1..2'
(no output).
It properly works if Blocking is on:
perl -MIO::Socket::IP -le 'push @a, IO::Socket::IP->new(LocalPort => 2345, Blocking =>1) || die "Fail: $@" for 1..2'
Fail: Address already in use at -e line 1.
It also worked fine in IO::Socket::INET:
perl -MIO::Socket::INET -le 'push @a, IO::Socket::INET->new(LocalPort => 2345, Blocking =>0) || die "Fail: $@" for 1..2'
Fail: IO::Socket::INET: Address already in use at -e line 1.
(tested with perl 5.30, IO::Socket::IP 0.39)