Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm using the frontier module for my XML-RPC server and have run into what I hope is a small issue. My function occasionaly takes longer then 3 minutes to do it's thing and causes my server to timeout. Is there a param I can pass either the constructor or use in the sub to increase this time?

Here is my sample code:

use constant WEBSERVER => 'my-server'; use constant PORT => '1087'; use Frontier::Daemon; my $d = Frontier::Daemon->new( methods => { TestLargeCall => \&TestLargeCall, }, LocalAddr => WEBSERVER, LocalPort => PORT, ); sub TestLargeCall { # process takes more then the default 180 secs }

Thanks

Replies are listed 'Best First'.
Re: XML-RPC timeout ?
by dHarry (Abbot) on Jul 22, 2008 at 11:30 UTC

    I am not much into OO Perl (my OO stems from other languages) so with the risk of talking complete BS:

    Frontier::Daemon is a subclass of HTTP::Daemon, which is a subclass of IO::Socket::INET. Can’t you set the Timeout value for IO::Socket::INET?

      Any idea how would I set that value after creating and starting my server?

        IO::Socket::INET is built upon the IO::Socket interface and inherits all the methods defined by IO::Socket.

        IO::Socket has the method timeout(value) Set or get the timeout value associated with this socket.

        If called without any arguments then the current setting is returned. If called with an argument the current setting is changed and the previous value returned.

        So I sort of assumed you can use this. Let’s not forget I am just a novice ;-) Where are the experienced monks when you really need them?

        BTW I am reading awful things about Timeout: See http://www.webmasterworld.com and http://www.dbforums.com

        Hope this helps

Re: XML-RPC timeout ?
by Anonymous Monk on Jul 23, 2008 at 04:29 UTC