Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:05:24+00:00 2026-06-16T04:05:24+00:00

I’m using HttpRequest and HttpRequestPool to send parallel http requests, the number of requests

  • 0

I’m using HttpRequest and HttpRequestPool to send parallel http requests, the number of requests is up to 200 or something, the thing is that some of the receivers might be offline, so that HttpRequestPool::send() will wait until it gets a response or until it times out.

Example of usage:

    $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();

In my php error log i get errors, can someone tell me what I have to do to avoid them? I’m guessing that this happens mostly because of timed out requests to invalid destinations, becaues all receivers that are valid do get the message and act accordingly.
Any suggestions?
Ty in advance.

**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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:05:26+00:00Added an answer on June 16, 2026 at 4:05 am

    Okay, this question was around here for a while and not answered. So I’ll say what I did to get rid of the errors.

    $pool = new HttpRequestPool(); 
    
    //Add the data to the request pool.
    foreach($boardsURLS as $boardURL)
    {   
        $req = new HttpRequest($boardURL.'/', HTTP_METH_POST); 
        $req->setBody($message);
        $req->setOptions(array('connecttimeout' => 3, 'timeout' => 3));
        $pool->attach($req);    
    } 
    
    $ErrorLog = fopen('Logs/GameEnd.txt', "a+");
    
    try
    {
        $pool->send();
    }
    catch(HttpException $ex)
    {
        fprintf($ErrorLog, '%s', $ex);  
    }
    
    fclose($ErrorLog);
    

    The “errors” were exceptions, and since I didn’t handle them they were added in the php53_errors.log. Now by adding try and catch, the exceptions could be handled so that solved it. Now I store the exceptions(timeout exceptions) in a separate file (that’s because i wanted to) someone else can handle them differently of course. So not much I can do about it.

    NEXT

    $req->setOptions(array('connecttimeout' => 3, 'timeout' => 3));
    

    This is the part I like. Since I don’t really care about the response, I just want my http requests to get transmited to the receivers. I put a timeout of 3 seconds. That prevents my script from keep running and waiting for the responses.

    Hope this will help someone. Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.