Use the same Ranch listener ID pattern as in the core

Spotted by @essen.

Part of rabbitmq/rabbitmq-server#2321.
This commit is contained in:
Michael Klishin 2020-06-23 23:57:08 +03:00
parent fc5c94047b
commit 7ab5ef169f
1 changed files with 5 additions and 2 deletions

View File

@ -26,6 +26,8 @@
%% supervisor callbacks
-export([init/1]).
-import(rabbit_misc, [pget/2]).
%% @spec start_link() -> ServerRet
%% @doc API for starting the supervisor.
start_link() ->
@ -77,8 +79,9 @@ init([]) ->
%% ----------------------------------------------------------------------
name(Listener) ->
Port = proplists:get_value(port, Listener),
list_to_atom(atom_to_list(?MODULE) ++ "_" ++ integer_to_list(Port)).
Port = pget(port, Listener),
[{IPAddress, Port, _Family} | _] = rabbit_networking:tcp_listener_addresses(Port),
{acceptor, IPAddress, Port}.
preprocess_config(Options) ->
case proplists:get_value(ssl, Options) of