Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Some API for detecting bind errors #51

maxlapshin opened this Issue · 4 comments

2 participants


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")

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.


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


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.


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.