inets: request error on Windows XP

Ingela Anderton <>
Mon May 2 11:59:53 CEST 2005


Ulf Wiger \(AL/EAB\) wrote:
> 
> Anders Nygren wrote:
> 
> > This looks like a problem I have had too.
> > See,
> > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00014.html
> > http://www.erlang.org/ml-archive/erlang-questions/200503/msg00045.html
> > 
> > I never got any response to those, and I never found the problem.
> > I am happy to see that it works with a name instead of IP address.
> 
> Following the second link, I found:
> 
> > or from the shell
> > 7>Port=erlang:open_port({spawn,tcp_inet},[binary]).
> > #Port<0.36>
> > 8>erlang:port_control(Port,1,[2]).
> > [0,101,105,110,118,97,108]
> > 
> > The funny thing is that I can set up a tcp connection
> > from the windows machine to the linux machine. But
> > not from the windows machine to the internet.
> 
> The way it looks like (to me, who don't know the inet driver),
> is that you're trying to open an IPv6 socket, and your 
> system doesn't support it (or, perhaps, Erlang on Windows
> wasn't built with IPv6 support enabled).
> 
> I believe Windows XP has v6 support starting with SP1.
> 
> Going from your windows machine to Internet, why would 
> you want to run IPv6?
Looks like this problem could be releated to the inet-driver!

On my unix machine:
inet:getaddr("66.102.7.147", inet6).
{ok,{0,0,0,0,0,65535,16998,1939}}

On my windows machine:
inet:getaddr("66.102.7.147", inet6). 
{ok,{66,102,7,147}}

The reason why the http client will always try to use ipv6 is that
it can not know in all situations if the server is using ipv6 or
not. When trying to use ipv6 for a ipv4 host the address should be
translated to an ipv4 address on ipv6 format and everything
should run smoothly. Of course it would be possible to work around
this problem in the connect function in http_transport.erl

-- 
/Ingela - OTP team









More information about the erlang-questions mailing list