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

Re: [soaplite] SOAP::Lite timeout issue?

Expand Messages
  • Mark Fuller
    ... I don t know what the correct answer is regarding S::L s handling of client connection timeouts. But, as a workaround, you should be able to set an alarm
    Message 1 of 2 , Jul 12 1:39 PM
    • 0 Attachment
      --- Dominick Meglio <dmeglio@...> wrote:

      > My question is, how do I get the connect attempt to
      > stop if my
      > specified timeout has elapsed, and simply allow me
      > to detect the error
      > condition and allow my program to continue on?

      I don't know what the correct answer is regarding
      S::L's handling of client connection timeouts. But, as
      a workaround, you should be able to set an alarm
      within your eval and trap it. You need a signal
      handler for the alarm. I had an example of doing this
      with something else. I'd have to look for it. (It is a
      little trickier than it sounds because there's a race
      condition between the inner alarm and the outer eval.
      Something like that.)

      As far as eval'ing to trap fatal errors. I think
      that's relatively common. I know I had to do it with
      ssh::sftp. I didn't think it was too cumbersome. I had
      to accomodate for what may be multiple errors within
      an eval and that $@ will have the last error (which
      may not be as informative as earlier errors). I
      handled this with a signal handler to capture every
      warning event. I added each warning message to an
      array each time the signal handler was invoked. In the
      end, I had an array of messages (if multiple errors
      occured).

      =====
      my @warnings;

      $SIG{"__WARN__"} = sub { $warnings[$#warnings + 1] =
      $_[0]; };

      eval {$my_result = $object->function(".");};

      $SIG{"__WARN__"} = "DEFAULT";

      if ($#warnings > -1 or (!defined($pwd) or $pwd eq "")
      ) {
      # treat it as an error, display each row of @array
      }
      ======

      Maybe that would be useful to you?

      Mark




      __________________________________
      Yahoo! Mail for Mobile
      Take Yahoo! Mail with you! Check email on your mobile phone.
      http://mobile.yahoo.com/learn/mail
    Your message has been successfully submitted and would be delivered to recipients shortly.