Loading ...
Sorry, an error occurred while loading the content.

timeout problem

Expand Messages
  • Karsten Pawlik
    hi, during the writing of a small soap-frontend i came across a timing problem: - client max. lifetime = xx seconds - server produces a read timeout after xx
    Message 1 of 1 , Nov 7, 2002
    View Source
    • 0 Attachment
      hi,
      during the writing of a small soap-frontend i came across a timing
      problem:
      - client max. lifetime = xx seconds
      - server produces a read timeout after > xx seconds
      - client closes the connection
      - server tries to send the response onto the closed port wich causes
      a segfault in the SOAP::Transport::TCP::Server handler.

      i couldn't find anything apropriate in the newsgroups -
      has anyone got a clue how to resolve this one or has someone made
      similar expieriences and has already a solution for it?

      i used a suse linux 7.3 box with soap lite 0.55, perl v5.6.1 on an
      intel single processor box.

      thanks in advance
      karsten.

      here's the code i used to reproduce this problem:

      ###############################################
      # frontend server:
      ###############################################

      #!/usr/bin/perl
      use SOAP::Transport::HTTP;
      use Frontend;

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 99, Reuse => 1)
      -> serializer(Frontend->new)
      -> dispatch_to(Frontend)
      ;
      print "Contact to SOAP frontend server at ", $daemon->url, "\n";
      $daemon->handle;

      ###############################################
      # backend server:
      ###############################################

      #!/usr/bin/perl
      use SOAP::Transport::HTTP;
      use MySerializer;

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 98, Reuse => 1)
      -> serializer(MySerializer->new)
      -> dispatch_to(MySerializer)
      ;
      print "Contact to SOAP backend server at ", $daemon->url, "\n";
      $daemon->handle;


      ###############################################
      # backend module:
      ###############################################

      #!/usr/bin/perl
      package MySerializer;
      @MySerializer::ISA = 'SOAP::Serializer';
      sub envelope {
      $i = 0;
      while(true) {
      if ($i >= 20000000000){
      break;
      }
      $i++;
      }
      }
      1;


      ###############################################
      # frontend module
      ###############################################

      #!/usr/bin/perl
      package Frontend;
      @Frontend::ISA = 'SOAP::Serializer';
      sub request {
      use SOAP::Lite;
      $soap_request = SOAP::Lite
      -> uri('http://localhost:98/MySerializer')
      -> proxy('http://localhost:98/Backend.pl');

      $soap_request->transport->timeout(20);
      @res = $soap_request->envelope()->paramsin;
      return(@res);
      }
      1;



      ###############################################
      # client
      ###############################################

      #!/usr/bin/perl

      use SOAP::Lite;
      $param = shift;

      $soap_response = SOAP::Lite
      -> uri('http://localhost:99/Frontend')
      -> proxy('http://localhost:99/frontend.pl');

      $soap_response->transport->timeout(10);
      @res = $soap_response->request(@parameters)->paramsin;

      foreach $result (@res) {
      print "$result\n";
      }

      the commandline output looks as follows:
      test:~/xt # ./client.pl
      500 read timeout
      at ./client.pl line 11
      test:~/xt # ./client.pl
      500 Connection reset by peer
      at ./client.pl line 11
      [1]- Broken pipe ./Frontend.pl
      test:~/xt # ./client.pl
      500 Can't connect to localhost:99 (Timeout)
      at ./client.pl line 11
      test:~/xt # ./client.pl
      500 Can't connect to localhost:99 (Timeout)
      at ./client.pl line 11
      test:~/xt # ./client.pl
      500 Can't connect to localhost:99 (Timeout)
      at ./client.pl line 11
    Your message has been successfully submitted and would be delivered to recipients shortly.