I have a Perl SOAP::Lite client and server. I specify keep_alive in the client, but the client closes the connection after the server responds with Keep-Alive. Here's the client code:
use warnings; use strict; use SOAP::Lite; my $som = SOAP::Lite->uri('http://my_namespace/SOAP_ImageMgr') ->proxy('http://wshost/cgi-bin/imagemgr/imagemgr', timeout => 30, keep_alive => 1); my $url = 'http://image-url/'; for (1 .. 100) { my $resp = $som->get_image_token($url, 260, 260); if ($resp->fault()) { die("$0: can't get image handle for $url(260): ", $resp->faultstring(), "\n"); } print $resp->result(), "\n"; }
I have a tcpdump that shows a close from the client after each response from the server; then a brand new connection is opened for the next request. My server is a simple dispatch to an in-line package. How do I get the client to use the open connection instead of closing and re-opening?
$ perl -v This is perl, v5.8.3 built for x86_64-linux-thread-multi $ perl -MSOAP::Lite -wle 'print $SOAP::Lite::VERSION' 0.60 $ perl -MLWP::UserAgent -wle 'print $LWP::UserAgent::VERSION' 2.033 $ perl -MLWP::ConnCache -wle 'print $LWP::ConnCache::VERSION' 0.01 $

In reply to SOAP::Lite Client Closes Keep-Alive Connection by garry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.