traffic control question

Discussion in 'Perl Misc' started by a, Aug 16, 2006.

  1. a

    a Guest

    If I want to process the search result, I need to fill out the form, submit
    and wait for the reply from the server before I process the search result.
    I would like to add some traffic control to it, like writing a loop to wait
    for the $response -> is_success, then break the loop. It may need to pass
    the token to the OS for receiving the success message. How can I do it?
    Thanks

    e.g
    my $ua = LWP::UserAgent -> new;
    my $response = $ua->post(
    "website.cgI",
    [
    textform => "search value"
    ]
    );
    #loop wait for is_success
    if ($response -> is_success){
    print $response -> status_line;
    }
    #loop
     
    a, Aug 16, 2006
    #1
    1. Advertising

  2. a

    J. Gleixner Guest

    a wrote:
    > If I want to process the search result, I need to fill out the form, submit
    > and wait for the reply from the server before I process the search result.


    How else would you process the result if you don't wait for the reply?

    > I would like to add some traffic control to it, like writing a loop to wait
    > for the $response -> is_success, then break the loop.


    You don't need to "loop", you simply wait for the response. The request
    will succeed or fail.

    Post the request.
    Wait for success/failure.
    if success, do something else
    else it's a failure, do something else

    >It may need to pass
    > the token to the OS for receiving the success message. How can I do it?


    What the heck is "the token"?

    Give us some code with more of what you're wanting to do.
     
    J. Gleixner, Aug 17, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yves Tchapda

    Network Traffic Models Generation

    Yves Tchapda, Jan 29, 2004, in forum: VHDL
    Replies:
    1
    Views:
    523
    Mike Treseler
    Jan 29, 2004
  2. John A Grandy

    hi-traffic websites & session-state

    John A Grandy, Jul 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    408
    Joe Fallon
    Jul 3, 2004
  3. Jimmy

    High traffic websites

    Jimmy, Apr 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    715
    Juan T. Llibre
    Apr 28, 2005
  4. Frankie

    Site Traffic Reporting

    Frankie, Jun 20, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    1,089
    Amedee Van Gasse
    Jun 22, 2005
  5. wesley chun
    Replies:
    0
    Views:
    272
    wesley chun
    Nov 9, 2006
Loading...

Share This Page