[erlang-questions 21] Re: dialyzer and ssl

Roberto Ostinelli <>
Sat Mar 26 11:39:32 CET 2011


hi anders,

transport_accept/2 does return {ok, NewSocket} | {error, Reason} in my
example here below. plus, it's the ssl_accept/2 that dialyzer is complaining
on, at line 4.

2011/3/25 Anders Nygren <>

> According to the documentation transport_accept/2 returns
> {ok, NewSocket} | {error, Reason}
> Which is what dialyzer also claims. So Your case clause on line 4
> can never match.
>
> /Anders
>
> On Thu, Mar 24, 2011 at 2:27 PM, Roberto Ostinelli <>
> wrote:
> > dear list,
> >
> > i'm getting this dialyzer warning i cannot understand:
> >
> > "The pattern 'ok' can never match the type {'error',_} |
> > {'ok',{'sslsocket',_,_}}"
> >
> > this points to line 4 of this code extract:
> >
> > 1. case ssl:transport_accept(ListenSocket) of
> > 2.    {ok, {sslsocket, _, _} = Sock} ->
> > 3.        case ssl:ssl_accept(Sock, 60000) of
> > 4.            ok ->
> >                 ...
> > 5.            {error, _Reason} ->
> >                 ...
> > 6.        end
> > 7.    {error, _Reason} ->
> >         ...
> > 8. end
> >
> > afaik, ssl_accept/2 returns ok | {error, Reason} as per the specs:
> > http://www.erlang.org/doc/man/ssl.html#ssl_accept-2
> >
> > is this due to some discrepancy in docs/specs? or am i missing something?
> >
> > thank you,
> >
> > r.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110326/e0992923/attachment.html>


More information about the erlang-questions mailing list