in reply to LWP - timeout

You don't mention what platform you're running on. If you're on Win32, you may be SOL. Under the covers, LWP uses SIGALRM (in IO::Socket) for timeouts. Unfortunately, signals aren't supported on Win32.

See the "Quicks" page in the ActiveState FAQ for details.

(If someone knows otherwise, please set me straight. I've never been able to get timeouts working with LPW on Win32, but perhaps there's some trick.)

  • Comment on Re: LWP - timeout (out of luck on Win32)

Replies are listed 'Best First'.
Re: LWP - timeout (not entirely out of luck on Win32)
by MeowChow (Vicar) on Jan 27, 2001 at 00:22 UTC
    The IO::Socket modules use the timeout feature built into the select() system call to do timeouts when recving or sending data; however, in order to do a connect, they attempt to set the socket to non-blocking mode (which does not work properly without some cajoling on Win32 systems).

    For this reason, if you cannot actually connect to your peer's http port, a Win32 timeout on an LWP call will not work. If, however, you can connect to the peer's listening socket, then the timeout should work.

Re: Re: LWP - timeout (out of luck on Win32)
by agoth (Chaplain) on Jan 29, 2001 at 14:35 UTC
    Mercifully I'm on Solaris and occasionally FreeBSD,
    I know IO::Socket is installed, but i suspect the reason is as above.