Extract rabbit_networking:stop_ranch_listener_of_protocol/1

Part of rabbitmq/rabbitmq-server#2321
This commit is contained in:
Michael Klishin 2020-07-09 22:02:08 +03:00
parent 73b02e6845
commit b8565fe555
1 changed files with 2 additions and 9 deletions

View File

@ -60,8 +60,8 @@ init() ->
ok. ok.
stop(State) -> stop(State) ->
stop_ranch_listener(?TCP_PROTOCOL), rabbit_networking:stop_ranch_listener_of_protocol(?TCP_PROTOCOL),
stop_ranch_listener(?TLS_PROTOCOL), rabbit_networking:stop_ranch_listener_of_protocol(?TLS_PROTOCOL),
State. State.
-spec list_connections() -> [pid()]. -spec list_connections() -> [pid()].
@ -82,13 +82,6 @@ close_all_client_connections(Reason) ->
%% Implementation %% Implementation
%% %%
stop_ranch_listener(Protocol) ->
case rabbit_networking:ranch_ref_of_protocol(Protocol) of
{error, not_found} -> ok;
undefined -> ok;
Ref -> ranch:stop_listener(Ref)
end.
connection_pids_of_protocol(Protocol) -> connection_pids_of_protocol(Protocol) ->
case rabbit_networking:ranch_ref_of_protocol(Protocol) of case rabbit_networking:ranch_ref_of_protocol(Protocol) of
undefined -> []; undefined -> [];