[erlang-questions] 12B4 ODBC problem

Anthony Shipman als@REDACTED
Thu Sep 11 12:34:56 CEST 2008


There is code in odbc:init() to automatically determine whether to use IPV6 or 
IPV4.

    Inet = case inet:getaddr("localhost", inet6) of
	       {ok, {_,_,_,_}} ->
		   inet;
	       {ok, {0, 0, 0, 0, 0, 16#ffff, _, _}} ->
		   inet;
	       {ok, {_,_,_,_,_,_,_,_}} ->
		   inet6;
	       _ ->
		   inet
	   end,

Unless I have /etc/hosts fixed just right then this makes a DNS query for 
localhost in a number of domains. This can delay the startup for quite a few 
seconds and it's no fun trying to figure out why.

How about adding an option {inet, ipv4 | ipv6 | auto} with ipv4 the default 
for compatibility with most installations?

-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.



More information about the erlang-questions mailing list