From: <php...@li...> - 2010-06-26 11:42:18
|
Hi Brian, > sleep(30); the default tomcat keep-alive timeout is 20000ms. If your script doesn't send any data within 20seconds, tomcat closes the connection. Please change tomcat's server.xml to <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="40000" redirectPort="8443" /> (there's no separate keepAliveTimeout; Tomcat uses the connectionTimeout for the keep-alive as well) The hanging at the end of the script is another problem. PHP/Java Bridge 6.0 uses HTTP/1.1 chunked connections, which require a shutdown sequence. From the current Java.inc: for ($this->res=$this->fread(10); strlen($this->res) < 10; $this->res.=$this->fread(10-strlen($this->res))); The "10" is the <F t="E"/>, which is okay. But I should have checked that the connection is still alive. Or simply replace the for loop with fread($sock, 10), as tomcat won't send the 10 bytes one-after-the-other. Thank you very much for reporting this issue. Regards, Jost Bökemeier |