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

Re: [soaplite] SOAP on TCP timeout

Expand Messages
  • Arun Kumar U
    Hi, Weidong and Paul ! ... Yes, Paul you are right. The TimeOut parameter works only for accept() on the server side and connect() on the client side. Not for
    Message 1 of 5 , Jun 28, 2001
    • 0 Attachment
      Hi, Weidong and Paul !

      > This setting works only for connect, but not for send/recv. Those are
      > blocking regardless of Timeout value, unless you change it.

      Yes, Paul you are right. The TimeOut parameter works only for accept() on
      the server side and connect() on the client side. Not for send/recv calls.

      The way out of this is to patch SOAP::Transport::TCP in such a way that
      the following calls

      1. print $sock $envelope
      2. my $result = join '', <$sock>;

      are replaced with two method calls that would send and recieve soap
      messages say SendSoapMessage() and RecieveSoapMessage()

      In the RecieveSoapMessage() method you can first select() (I use
      IO::Select and $select->can_read($TimeOut)) and check whether the
      filehandle is ready for reading. The select() call would have the TimeOut
      passed as a parameter (appropriately). This mechanism would give you the
      liberty to timeout on the receiving side as you desire.

      This will also eliminate the need to do line oriented IO.

      I know its not the best description of how to implement this. If you
      (Wiedong) are interested then I can send you my implementation.

      Best Regards,
      Arun

      On Wed, 27 Jun 2001, Paul Kulchenko wrote:

      > Hi, Weidong!
      >
      > My copy of IO::Socket::INET has this code:
      >
      > return _error($sock, $!, "Timeout")
      > unless @raddr;
      >
      > So, it returns Timeout regardless of Timeout value if it couldn't
      > connect to remote host (IO::Socket::INET: Timeout).
      >
      > > I tried "Timeout" already. I set it to 0, hoping to let the
      > > client wait forever (with timeout set to 0 for HTTP, it works that
      > > way), but my TCP client timeout by itself anyway.
      > This setting works only for connect, but not for send/recv. Those are
      > blocking regardless of Timeout value, unless you change it.
      >
      > You may also try to specify big value of Timeout. What error do you
      > have? Could someone experienced in sockets comment on this issue?
      >
      > Best wishes, Paul.
      >
      > --- Weidong Wang <wwang@...> wrote:
      > > Paul:
      > >
      > > I tried "Timeout" already. I set it to 0, hoping to let the
      > > client wait forever (with timeout set to 0 for HTTP, it works that
      > > way), but my TCP client timeout by itself anyway.
      > >
      > > Weidong
      > >
      > > ----- Original Message -----
      > > From: Paul Kulchenko
      > > To: soaplite@yahoogroups.com
      > > Sent: Wednesday, June 27, 2001 1:06 PM
      > > Subject: Re: [soaplite] SOAP on TCP timeout
      > >
      > >
      > > Hi, Weidong!
      > >
      > > It should be Timeout. It might be confusing sometimes, but
      > > choosing
      > > between having the same interface for ALL transports or have
      > > original
      > > interface for those transports, I choose the later. Working with
      > > specific transport, you may use the same options you would use
      > > working with it directly. So, code probably should look like:
      > >
      > > my $soap = SOAP::Lite
      > > -> proxy($proxy, Timeout => 10)
      > > -> uri($uri);
      > >
      > > Best wishes, Paul.
      > >
      > > --- Weidong Wang <wwang@...> wrote:
      > > > I need to make the client to wait much longer for the result to
      > > > come back.
      > > >
      > > > With SOAP on HTTP, I can do either
      > > >
      > > > my $soap = SOAP::Lite
      > > > -> proxy($proxy, timeout => 10)
      > > > -> uri($uri);
      > > >
      > > > or
      > > >
      > > > $soap->transport->timeout(10);
      > > >
      > > > But I also need to do so for a SOAP TCP client. Same tricks
      > > (with
      > > > $Poxy as
      > > > tcp:host:port) do not work. In the latter case, it simply said
      > > that
      > > > method
      > > > "timeout" cannot be located in the package
      > > > SOAP::Transport::TCP::Client.
      > > >
      > > > Looking at the TCP::Client code and IO::Socket code, it seems
      > > to me
      > > > that it
      > > > should work.
      > > >
      > > > Any ideas? Thanks.
      > > >
      > > > Weidong
      > > >
      > > >
      > > >
      > > > To unsubscribe from this group, send an email to:
      > > > soaplite-unsubscribe@yahoogroups.com
      > > >
      > > >
      > > >
      > > > Your use of Yahoo! Groups is subject to
      > > > http://docs.yahoo.com/info/terms/
      > > >
      > > >
      > >
      > >
      > > __________________________________________________
      > > Do You Yahoo!?
      > > Get personalized email addresses from Yahoo! Mail
      > > http://personal.mail.yahoo.com/
      > >
      > > Yahoo! Groups Sponsor
      > >
      > >
      > >
      > > To unsubscribe from this group, send an email to:
      > > soaplite-unsubscribe@yahoogroups.com
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > > Service.
      > >
      > >
      >
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Get personalized email addresses from Yahoo! Mail
      > http://personal.mail.yahoo.com/
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.