[erlang-questions] inets - http:request with invalid host

Ingela Anderton Andin ingela@REDACTED
Wed May 30 11:38:54 CEST 2007


Sanjaya Vitharana wrote:
> Attached are the traces. But still I can't find why this happens.
>   
It seems as if the call to gen_tcp:connect fails with a lowlevel timeout 
(timeout in the inet driver not controlled by the inets application),  
this  would  explain why 
the asynchronous call takes longer time, as the result of the 
asynchronous calls
is returned first thing after spawning the  request handler process  
(unless  the request is pipelined)
and the request handling process connects to the server in its init 
function. There is nothing really wrong with that, but as spawn of a 
gen_server process will not return on till init
returns it will in this particular case delay the result returned to the 
client.  It is probably a good idea for us to use  gen_server:enter_loop 
function that was invented
just because of the fact that it is hard to always keep init trivial 
enough. I will put this on the todo list. If you are able to connect to 
a host with gen_tcp directly but not with the http-client you
can try disabling ipv6 in the http-client.

Regards - Ingela OTP team




More information about the erlang-questions mailing list