summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEssien Ita Essien <essiene@gmail.com>2009-01-16 09:13:14 +0100
committerEssien Ita Essien <essiene@gmail.com>2009-01-16 09:13:14 +0100
commit6492e5cd2c47e564856fdb0f487e7b18a064b99e (patch)
tree3166176a8665468ea54f1087a7e10c2d6a890203
parent0bf61065bbf665286f6eb59d4ec3f1c548f8ee82 (diff)
downloadrabbitmq-server-git-6492e5cd2c47e564856fdb0f487e7b18a064b99e.tar.gz
Bring back start_ssl_listener/start_tcp_listener and make them
call the renamed start_listener which is now intended private
-rw-r--r--src/rabbit_networking.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index 69b1024b0c..0fb869d3ca 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -31,10 +31,11 @@
-module(rabbit_networking).
--export([start/0, start_tcp_listener/3, stop_tcp_listener/2,
- on_node_down/1, active_listeners/0, node_listeners/1,
- connections/0, connection_info/1, connection_info/2,
- connection_info_all/0, connection_info_all/1]).
+-export([start/0, start_tcp_listener/2, start_ssl_listener/3,
+ stop_tcp_listener/2, on_node_down/1, active_listeners/0,
+ node_listeners/1, connections/0, connection_info/1,
+ connection_info/2, connection_info_all/0,
+ connection_info_all/1]).
%%used by TCP-based transports, e.g. STOMP adapter
-export([check_tcp_listener_address/3]).
@@ -60,7 +61,8 @@
-type(connection() :: pid()).
-spec(start/0 :: () -> 'ok').
--spec(start_tcp_listener/3 :: (host(), ip_port(), mfa()) -> 'ok').
+-spec(start_tcp_listener/2 :: (host(), ip_port()) -> 'ok').
+-spec(start_ssl_listener/3 :: (host(), ip_port(), [info()]) -> 'ok').
-spec(stop_tcp_listener/2 :: (host(), ip_port()) -> 'ok').
-spec(active_listeners/0 :: () -> [listener()]).
-spec(node_listeners/1 :: (erlang_node()) -> [listener()]).
@@ -104,7 +106,13 @@ check_tcp_listener_address(NamePrefix, Host, Port) ->
Name = rabbit_misc:tcp_name(NamePrefix, IPAddress, Port),
{IPAddress, Name}.
-start_tcp_listener(Host, Port, OnConnect) ->
+start_tcp_listener(Host, Port) ->
+ start_listener(Host, Port, {?MODULE, start_client, []}).
+
+start_ssl_listener(Host, Port, SslOpts) ->
+ start_listener(Host, Port, {?MODULE, ssl_connection_upgrade, [SslOpts]}).
+
+start_listener(Host, Port, OnConnect) ->
{IPAddress, Name} = check_tcp_listener_address(rabbit_tcp_listener_sup, Host, Port),
{ok,_} = supervisor:start_child(
rabbit_sup,