in reply to Killing a server-push stream in LWP?

Hmmmm ... well, you could try a time out:
$SIG{ALRM} = sub { die "timed out" }; eval { alarm(60); # give it 60 seconds $response = $useragent->simple_request($request,\&callback,2048); alarm(0); }; # now look for "timed out" in $@ if ($@ =~ /timed out/) { # do something }

UPDATE:
Bummer that you only have Win2k at your disposal. . As for killing the incoming stream - when are you setting $useragent to undef? Seems to me that you would never be able to that without a time out mechanism - the script would continue to wait indefinetly for the server to end the connection.

i thought you might be able to use something like:

undef $useragent if $@ =~ /timed out/;
but the whole having to deal with Win2k is a right bummer. Sorry i couldn't help more :(

jeffa

Replies are listed 'Best First'.
Re: (jeffa) Re: Killing a server-push stream in LWP?
by ryddler (Monk) on Oct 16, 2001 at 20:16 UTC

    While this might actually tell me that the process went longer than 60 seconds, unfortunately I can't test it because I'm on a Win2k box.

    However, it still doesn't address the issue of killing the incoming stream that the useragent is currently receiving ;)

    ryddler