[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to catch a "SetError() #6: connect(): A remote host refused an attempted connect operation" problem



Commenting the "d/define HTTP_BLOCK_ON_CONNECT" in CONFIG_H and re-compiling did do the trick! Now I get a "SetError() #7: Timeout occurred while trying to connect to server!"  after the number of seconds I set in the timeout. And that is what I wanted. 

I took the opportunity to download install the latest version of HTTPAPI.

Many thanks 
Ronnie, thanks for your retry algoritme

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Sunday, May 06, 2012 5:05 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: How to catch a "SetError() #6: connect(): A remote host refused an attempted connect operation" problem

Hiya Rick,

Do you have HTTP_BLOCK_ON_CONNECT defined in the CONFIG_H source member of HTTPAPI?  If so, please consider commenting that out and rebuilding HTTPAPI.  See if that helps with your problem.

If I'm understanding your situation correctly:  You are running HTTPAPI from a CGI job instance of Apache.  Using the "BLOCK_ON_CONNECT" option in HTTPAPI, HTTPAPI uses an alarm signal to perform time-out processing when connecting. But, Apache blocks signals, and so that timeout mechanism doesn't work in an Apache job.

When you change it to use a non-blocking timeout, HTTPAPI will not use signals anymore, but will use a nonblocking select for timeout. (This should solve the problem.)  Worth a try, at any rate.

-SK


On 5/4/2012 3:06 AM, Rick Bovet wrote:
>     Hi All,
>
>
>     We are using HTTPAPI to call a remote service. But for some reason, the
>     other party server is down. But we want to keep our application running
>     and have made provisions  if the data from that service is not
>     provided. However the connect() functions "hangs" for approx 2 minutes
>     before the "SetError() #6: connect(): A remote host refused an
>     attempted connect operation" is returned. This long duration is causing
>     a 500 error in our web-application.
>
>     I understand that this is not a HTTPAPI problem from the archives. But
>     I like to get around this. Is there any way that I can test whether the
>     remote host is available ?
>
>     I have set a timeout of 1 sec in the post. I also tried using the
>     http_set_100_timeout() API prior to the post. But at no effect. We are
>     using HTTPAPI version 1.23
>
>
>
>     Met vriendelijke groet / Kind regards,
>
>
>     Rick Bovet
>
>     Development Manager
>
>
>     P please observe the new direct dial below
>
>
>     cid:image001.png@01CB5418.F5751370
>
>     ECi Software Solutions
>
>     Siriusdreef 66, 2132 WT  Hoofddorp
>
>     Postbus 3005, 2130 KA  Hoofddorp
>
>     Netherlands
>
>     Tel. +31 (0)23-555 49 49
>     Fax +31 (0)23-562 58 48
>
>
>     Direct dial: +31 (0)23-564 98 55
>
>
>     [1]rbovet@xxxxxxxxxxxxxxxx
>
>     [2]www.eci.eu&  [3]www.easyorder.eu
>
>     ECi Software Solutions is a division of eCommerce Industries, Inc
>     [4]www.ecisolutions.com
>
>     P please consider the environment before printing this e-mail
>
> References
>
>     1. mailto:jenaam@xxxxxxxxxxxxxxxx
>     2. http://www.eci.eu/
>     3. http://www.easyorder.eu/
>     4. http://www.ecisolutions.com/
>
>
>
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------