Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl LWP close connection manually
    primarykey
    data
    text
    <p><strong>New Question:</strong></p> <p>I'm doing the following with my Perl script:</p> <pre><code>use strict; use warnings; use LWP 5.64; my $browser = LWP::UserAgent-&gt;new(); $browser-&gt;credentials( 'localhost:8080', 'Tomcat Manager Application', 'admin' =&gt; '123' ); my $app_url = qq(http://localhost:8080/manager/list); my $response = $browser-&gt;get( $app_url ); #this starts the Tomcat Manager Application #do something #end the tomcat manager application / terminate the session </code></pre> <p>Is there a way to end the session? The default session timeout for my Manager Application is 30 minutes. What I've tried is:</p> <pre><code>my $browser = LWP::UserAgent-&gt;new(); $browser-&gt;conn_cache(LWP::ConnCache-&gt;new()); </code></pre> <p>But it still opens a new session always. </p> <p>I think changing <code>$browser-&gt;timeout</code> is not the right approach here because I need to terminate the session after I already received the response.</p> <p>Any help will be greatly appreciated.</p> <hr> <p><strong>Old Question:</strong></p> <p>Is there a way to end my session manually using LWP? I have something like:</p> <pre><code>use strict; use warnings; use LWP 5.64; my $app_url = 'htpp://localhost:8080/manager/list' my $base_url = 'http://localhost:8080' my $browser = LWP::UserAgent-&gt;new; $browser-&gt;credentials( 'localhost:8080/manager/list', 'Tomcat Manager Application', 'admin' =&gt; '123' ); my $response = $browser-&gt;get( $base_url ); #session does not remain open my $respuesta = $browser-&gt;get( $app_url ); #session remains opened #do some processing #and now close the connection </code></pre> <p>I want to run my script many consecutive times and after a while I have a million open sessions on the server. </p> <p>Thank you in advance for any answers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload