… | |
… | |
827 | $! = Errno::ETIMEDOUT; |
827 | $! = Errno::ETIMEDOUT; |
828 | $state{next}(); |
828 | $state{next}(); |
829 | }) if $timeout; |
829 | }) if $timeout; |
830 | |
830 | |
831 | # called when the connect was successful, which, |
831 | # called when the connect was successful, which, |
832 | # in theory, could be the case immediately (but never is in practise) |
832 | # in theory, could be the case immediately |
|
|
833 | # (but only happens in special cases) |
833 | $state{connected} = sub { |
834 | $state{connected} = sub { |
834 | # we are connected, or maybe there was an error |
835 | # we are connected, or maybe there was an error |
835 | if (my $sin = getpeername $state{fh}) { |
836 | if (my $sin = getpeername $state{fh}) { |
836 | my ($port, $host) = unpack_sockaddr $sin; |
837 | my ($port, $host) = unpack_sockaddr $sin; |
837 | |
838 | |