From 81db97fc9e73d547327ecad3e149774cbf63ab31 Mon Sep 17 00:00:00 2001 From: Lois Soto Lopez Date: Mon, 11 Mar 2024 14:10:12 +0100 Subject: [PATCH] Use rabbit_networking new fun to list connections Discussion #9302 --- deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_app.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_app.erl b/deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_app.erl index 0cccdfb14a2a..fc6424ffae4f 100644 --- a/deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_app.erl +++ b/deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_app.erl @@ -50,8 +50,8 @@ init([]) -> {ok, {{one_for_one, 1, 5}, []}}. -spec list_connections() -> [pid()]. list_connections() -> - PlainPids = connection_pids_of_protocol(?TCP_PROTOCOL), - TLSPids = connection_pids_of_protocol(?TLS_PROTOCOL), + PlainPids = rabbit_networking:list_local_connections_of_protocol(?TCP_PROTOCOL), + TLSPids = rabbit_networking:list_local_connections_of_protocol(?TLS_PROTOCOL), PlainPids ++ TLSPids. -spec emit_connection_info_all([node()], rabbit_types:info_keys(), reference(), pid()) -> term(). @@ -77,12 +77,6 @@ emit_connection_info(Items, Ref, AggregatorPid, Pids) -> %% Implementation %% -connection_pids_of_protocol(Protocol) -> - case rabbit_networking:ranch_ref_of_protocol(Protocol) of - undefined -> []; - AcceptorRef -> ranch:procs(AcceptorRef, connections) - end. - mqtt_init() -> CowboyOpts0 = maps:from_list(get_env(cowboy_opts, [])), CowboyWsOpts = maps:from_list(get_env(cowboy_ws_opts, [])),