Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Some API for detecting bind errors #51

Closed
maxlapshin opened this Issue · 4 comments

2 participants

@maxlapshin

When I start ranch acceptor, there may be errors like {error, eaccess} or {error, eaddrinuse}.

There is no way to catch this error in upper application and make proper user request.

I think it would be good to have some API like:

case ranch:start(...) of
  {ok, _} -> ok;
  {error, eaccess} -> error_logger:error_msg("Bind to privileged port");
  {error, eaddrinuse} -> error_logger:error_msg("Port is used")
end 
@essen
Owner

That's not going to be done. However you can use the socket option to first bind the socket and only after start the listener. The transport options would be [{socket, Socket}] instead of what you currently use.

@maxlapshin

Why don't you want to add some API for checking errors on start?

@essen
Owner

Because there is no interest, and there is already a much simpler alternative than trying to parse the mess of errors the supervisor start failure would give us.

@essen
Owner

Closing, thanks.

@essen essen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.