Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I need to write a couple of perl scritps to do some stress-testing on some new network equipment. One of the requirements is that I need to make a few dozen http connections to a webserver (which is easy using LWP::UserAgent) and hold them open (which I have no idea how to do). Can anyone offer suggestions on how I can hold HTTP connections open?

Many thanks!

Replies are listed 'Best First'.
Re: Hold HTTP Connections Open?
by liz (Monsignor) on Nov 17, 2003 at 13:59 UTC
    Look for "keep_alive" in the LWP::UserAgent documentation. Of course, this will only work if the webserver in question supports Keep-Alive headers.

    Liz

Re: Hold HTTP Connections Open?
by edan (Curate) on Nov 17, 2003 at 13:58 UTC

    Add a keep_alive argument to your  LWP::UserAgent->new call.

    --
    3dan

Re: Hold HTTP Connections Open?
by Anonymous Monk on Nov 17, 2003 at 14:04 UTC
    I should also mention, I'm supposed to grab each file twice--once using HTTP/1.0 and once using HTTP/1.1.
      I should also mention, I'm supposed to grab each file twice--once using HTTP/1.0 and once using HTTP/1.1.
      keep_alive is a feature of HTTP/1.1. If you're going to be programming with HTTP, you need to know what it is and how it works. LWP::Protocol::http10