summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-01-21 13:06:59 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-01-21 13:06:59 +0000
commit757c22979b3eed9ec19170c6b4e7de1c78f84d2a (patch)
tree9ceef5cf3d805f7d6a2ca8e6eafde085416aa45e /src
parent785dbad7489bd767da160e7bd7495c2f37559f1e (diff)
downloadrabbitmq-server-git-757c22979b3eed9ec19170c6b4e7de1c78f84d2a.tar.gz
USe pg_local rather than an ets table.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_networking.erl9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index ee430fb407..080e09875c 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -41,8 +41,6 @@
-define(FIRST_TEST_BIND_PORT, 10000).
--define(CONNECTION_TABLE, rabbit_connection).
-
%%----------------------------------------------------------------------------
-ifdef(use_specs).
@@ -122,7 +120,6 @@
%%----------------------------------------------------------------------------
boot() ->
- ets:new(?CONNECTION_TABLE, [public, named_table]),
ok = start(),
ok = boot_tcp(),
ok = boot_ssl().
@@ -300,15 +297,15 @@ start_client(Sock) ->
start_ssl_client(SslOpts, Sock) ->
start_client(Sock, ssl_transform_fun(SslOpts)).
-register_connection(Pid) -> ets:insert(?CONNECTION_TABLE, {Pid}), ok.
+register_connection(Pid) -> pg_local:join(rabbit_connections, Pid).
-unregister_connection(Pid) -> ets:delete(?CONNECTION_TABLE, Pid), ok.
+unregister_connection(Pid) -> pg_local:leave(rabbit_connections, Pid).
connections() ->
rabbit_misc:append_rpc_all_nodes(rabbit_mnesia:cluster_nodes(running),
rabbit_networking, connections_local, []).
-connections_local() -> [P || {P} <- ets:tab2list(?CONNECTION_TABLE)].
+connections_local() -> pg_local:get_members(rabbit_connections).
connection_info_keys() -> rabbit_reader:info_keys().