Sockets on IRIX

Raimo Niskanen raimo@REDACTED
Mon Nov 6 14:22:22 CET 2000


We have a slight problem with the name lookup. For some reasons
(performance, historical, ...) we use an own DNS client written in
Erlang, and it seems that this client does not work well on all
platforms {error, timeout}.

I am of course not certain that this is the problem, it also depends of
the contents of the /etc/hosts, /etc/resov.conf, /etc/host.conf,
/etc/nsswitch.conf, /etc/irs.conf, etc. files.

There is a (undocumented) way to override the emulator's default
behaviour, which might be needed in this case: Create a file ".inetrc"
in Your home directory, in the current working directory or in the
${OTP_ROOT}/bin directory (I will come back to this later), with the
contents:

	{lookup, ["native"]}.

This will force all name lookups to be done through an external port
program that uses the native "gethostbyname" and such library calls.
Since all name querys are passed through a port program (for thread
safety reasons), performance may be lower, but certanly not noticabely.

There are some other places to put this ".inetrc" file, ask again if
this is necessary, or read the source, /lib/kernel/src/inet_config.erl.

The $OTP_ROOT directory can be found by starting Erlang with "erl
-emu_args", and copy the first argument after the '-root' switch.

/ Raimo Niskanen, Erlang/OTP



Björn Wingman wrote:
> 
> Hello,
> 
> I'm having problems opening sockets with erlang R7B on IRIX 6.5. On
> solaris everything works fine, but on irix gen_tcp:connect always dies
> with {error,timeout}. This is how I call it:
> 
> Conn = gen_tcp:connect(Host, Port,
>                        [list, {packet, raw},{reuseaddr,false},{active,false}]),
> 
>         /Björn Wingman



More information about the erlang-questions mailing list