[erlang-questions] Dialyzer and gen_tcp:listen

Koushik Narayanan <>
Sat Dec 27 15:01:19 CET 2008

Hi All,

The gen_tcp:listen function returns an {ok,ListenSocket} or {error,Reason} immediately.

But somehow for code like this:

init([Config_record]) ->
        case inet:gethostbyname(Config_record#config.hostname) of
                {ok, {hostent, _HostName,_Unused,inet,_Ver,[IP]}} ->
                                HTTP_IP = IP;
                _ ->
                        HTTP_IP = {127,0,0,1}
        {ok,Listen} = gen_tcp:listen(Config_record#config.port,[list,
                                          {active, false},
        do_accept(Listen), %% returns immediately 

The dialyzer says init/1 has no local return.

Why so?

The same code using ssl:listen though passes the dialyzer.

What am I missing here?


Koushik Narayanan

More information about the erlang-questions mailing list