我正在使用HttpRequest
andHttpRequestPool
发送并行 http 请求,请求数最多为 200 或其他东西,问题是某些接收器可能处于脱机状态,因此HttpRequestPool::send()
将等到它得到响应或直到它超时。
使用示例:
$query = "CALL GetBoardsURLS()";
$result = mysql_query($query) or die("ERROR:QUERY_FAILED 8" . mysql_error());
$pool = new HttpRequestPool();
//Add the data to the request pool.
while($row = mysql_fetch_row($result))
{
$req = new HttpRequest($row[0].'/', HTTP_METH_POST);
$req->setBody($message);
$pool->attach($req);
}
$pool->send();
在我的 php 错误日志中,我得到了错误,有人可以告诉我我必须做些什么来避免它们吗?我猜这主要是因为对无效目的地的请求超时,因为所有有效的接收者都会收到消息并采取相应的行动。有什么建议么?提前泰。
**ERRORS**:
[13-Nov-2012 14:20:00 UTC] PHP Fatal error: Uncaught exception HttpRequestPoolException' with message 'Exception caused by 2 inner exception(s)' in C:\inetpub\wwwroot\DeusTesting\TimeSet.php:130
inner exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: ''' in C:\inetpub\wwwroot\DeusTesting\TimeSet.php:0
inner exception 'HttpRequestException' with message 'Timeout was reached; Connection time-out (http://sim6261.agni.lindenlab.com:12046/cap/11b23456-63bd-1c56-8692-b640ac992a76/)' in C:\inetpub\wwwroot\DeusTesting\TimeSet.php:130
Stack trace:
#0 C:\inetpub\wwwroot\DeusTesting\TimeSet.php(0): HttpRequestPool->send()
#1 {main}
thrown in C:\inetpub\wwwroot\DeusTesting\TimeSet.php on line 130
[13-Nov-2012 14:30:03 UTC] PHP Fatal error: Uncaught exception 'HttpRequestPoolException' with message 'Exception caused by 12 inner exception(s)' in C:\inetpub\wwwroot\DeusTesting\TimeSet.php:130