[erlang-questions] inets - http:request with invalid host ip (Sanjaya Vitharana)

Ingela Anderton Andin ingela@REDACTED
Tue May 29 11:18:36 CEST 2007


> Hi,
>
> Of cource I put an ip which is not visible (and url also not there). 
>
> 2> test:test_url().
>  URL="http://202.124.160.149/src/cf/1414/cricket/scoreline_odi/menu.php?key=1&session=a02857230011801002496201&ch=58&serverid=1"
>  Time for Synchronous request 189028171 microseconds ResSync={error,etimedout}
>  Time for Asynchronous request 188972235 microseconds ResASync={ok,
>                                                                 #Ref<0.0.0.119>}
>
> Check the above results for time taken to execute http:request. (test code attached)
>
> 1.) It has taken a large amount of time to execute both requests
> 2.) And time difference to exit from Synchronous and Asynchronous request are approximately same.
>
> Is this OK ???
>
> What I am thinking is the time taken to perform Asynchronous request as not acceptable. Am I wrong ?
> If the IP is not visible (or not available) Why such long time taken to give ANY result ?
>
> Is this a bug ?
>   
Which version of inets are you using? I just tried your URL and for a  
synchronous request
I got {ok,{{"HTTP/1.1",503,"Service Unavailable"}, ...  after some time 
and the asynchronous
version almost immediately  returned  {ok, #Ref<0.0.0.97>} as expected.

Regards Ingela - OTP team






More information about the erlang-questions mailing list