This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Cygwin Perl LWP timeout workaround

I seem to get intermittent socket timeout problems with perl's LWP
(libwww-perl). I unfortunately cannot reproduce the problem reliably,
so debugging it is almost impossible. Even if I supply a large timeout
value (300 s), LWP sometimes returns a timeout immediately.

In /usr/lib/perl5/5.6.1/cygwin/IO/, the connect subroutine
sets $sock->blocking(0) if there is a timeout value. (Shouldn't a
timeout value turn blocking on?)

I'd work on this more, but I unfortunately can't 

One workaround is to change
/usr/lib/perl5/site_perl/5.6.1/LWP/Protocol/ to stop passing
Timeout values. I got the idea from an earlier post on the cygwin
mailing list regarding Net::SMTP and Net::POP3:

My cygcheck and perl -V are at the bottom of this message:

And here's a one-character patch:

--- Tue Aug 14 14:25:44 2001
+++     Tue Aug 14 14:37:58 2001
@@ -28,7 +28,7 @@
     my $sock = IO::Socket::INET->new(PeerAddr => $host,
                                     PeerPort => $port,
                                     Proto    => 'tcp',
-                                    Timeout  => $timeout,
+#                                   Timeout  => $timeout,
     unless ($sock) {
Michael Hoffman <>
Cold Spring Harbor Laboratory

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]