Re: XML-RPC problem with long running times

From: Date: Thu, 29 Dec 2005 14:58:29 +0000
Subject: Re: XML-RPC problem with long running times
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-227971@lists.php.net to get a copy of this message
Of course, fflusch($log); should be fflush($log); I just found out that $xmlResponse really is empty. However, connection_status() returns 0, so I assume that the script is not interrupted by a timeout. Why does xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL) return nothing if the call takes longer than 5 minutes and there is no interrupt? Is there some "special" XMLRPC timeout? Any idea? Andreas Andreas Schlicker schrieb:
Hi all, I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22, OpenSSL/0.9.6a. I wrote a dummy script that is called by a Java program via XML-RPC, waits for some time and replies the start and end times. <?php set_time_limit(500); $xmlServer = xmlrpc_server_create(); function process() {
        $result = ini_get('max_execution_time') . "\n";
        $result = $result . date("H:i:s") . "\n";
        sleep(0);
        $result = $result . date("H:i:s") . "\n";
        return $result;
} xmlrpc_server_register_method($xmlServer, 'process', 'process'); $xmlRequest = $HTTP_RAW_POST_DATA; $xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL); #$log = fopen($filename, 'a'); #fwrite($log, $xmlResponse); #fflusch($log); #fclose($log); echo $xmlResponse; xmlrpc_server_destroy($xmlServer); ?> If the script sleeps for up to 5 minutes, it works perfectly fine. However, I my real application will run probably an hour or so. If the script takes more than 5 minutes to execute, the client receives an empty response, even the header is missing. If I try to write the $xmlResponse to a file, the client receives a null message. I wrote a small script without XMLRPC that acted the same way when called by a browser. This worked perfectly (I tested it up to 20 minutes waiting time) even if I used set_time_limit(5) and sleep(500). Does anybody have an idea how to solve this problem? Thanks in advance. Andreas


« previous php.general (#227971) next »