Rob Brown wrote:
>
> Wow, this seems nastier than I was hoping. I didn't
> think about the dual CPU boxes and such that could
> cause a non-blocking connect to really connect
> or return the error code immediately. I also still
> think that it COULD be a matter of Fcntl because when
> I comment out this section:
>
> $ grep -2 fcntl lib/Net/Ping.pm
> # Set O_NONBLOCK property on filehandle
> my $flags = 0;
> if (fcntl($fh, F_GETFL, $flags)) {
> if (!fcntl($fh, F_SETFL, $flags | O_NONBLOCK)) {
> croak("fcntl F_SETFL: $!");
> }
> } else {
> croak("fcntl F_GETFL: $!");
> }
>
> everything happens and fails exactly like you say
> occurs on freebsd and solaris boxes even on linux.
> And this is exactly the behavior on Win32 platform
> whether I comment it out or not.
>
> NOTE: If this is not the most correct way to do a
> nonblocking tcp connect, then tell me and I'll make
> the repairs. How does &IO::Handle::blocking or
> &IO::Socket::INET::connect implement it? Similar,
> right?
>
> Okay, I'm even handling this case too. Are there
> any errors now? Do a whole "make test":
>
> cvs -z3 -q -d :pserver:[EMAIL PROTECTED]:/usr/local/cvsroot/freeware
>checkout Net-Ping
> cd Net-Ping
> perl Makefile.PL
> make
> make test
Works fine on Irix and RedHat 8.0.
Best,
Blair
--
Blair Zajac <[EMAIL PROTECTED]>
Web and OS performance plots - http://www.orcaware.com/orca/