diff options
| author | Matthias Radestock <matthias@lshift.net> | 2008-11-19 15:02:20 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2008-11-19 15:02:20 +0000 |
| commit | 6cf3d7d3e4a71a3a1422eca7d1ed703005b6fff0 (patch) | |
| tree | 83aff082ca60a6740f8602fb8860c3370a4bcecb | |
| parent | 6ac77a9ec2f53357d84386c2266927c5e3b4174a (diff) | |
| download | rabbitmq-server-git-6cf3d7d3e4a71a3a1422eca7d1ed703005b6fff0.tar.gz | |
add function to get hold of all connections (i.e. reader pids)
| -rw-r--r-- | src/rabbit_networking.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 79c927cb9e..9fc3450313 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -26,7 +26,8 @@ -module(rabbit_networking). -export([start/0, start_tcp_listener/2, stop_tcp_listener/2, - on_node_down/1, active_listeners/0, node_listeners/1]). + on_node_down/1, active_listeners/0, node_listeners/1, + connections/0]). %%used by TCP-based transports, e.g. STOMP adapter -export([check_tcp_listener_address/3]). @@ -46,6 +47,7 @@ -spec(stop_tcp_listener/2 :: (host(), ip_port()) -> 'ok'). -spec(active_listeners/0 :: () -> [listener()]). -spec(node_listeners/1 :: (node()) -> [listener()]). +-spec(connections/0 :: () -> [pid()]). -spec(on_node_down/1 :: (node()) -> 'ok'). -spec(check_tcp_listener_address/3 :: (atom(), host(), ip_port()) -> {ip_address(), atom()}). @@ -136,6 +138,10 @@ start_client(Sock) -> Child ! {go, Sock}, Child. +connections() -> + [Pid || {_, Pid, _, _} <- supervisor:which_children( + rabbit_tcp_client_sup)]. + %%-------------------------------------------------------------------- tcp_host({0,0,0,0}) -> |
