aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_listener_sup.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-07-24 12:58:54 +0200
committerLoïc Hoguin <[email protected]>2012-07-25 10:05:15 +0200
commitb72fe3e67e65c66d979a9651ebc815bdc553601c (patch)
treeb6014dcc9ed930c885851d0c56b200612dc77738 /src/ranch_listener_sup.erl
parented50a5556a788a9780b5a8f85764b509338c1073 (diff)
downloadranch-b72fe3e67e65c66d979a9651ebc815bdc553601c.tar.gz
ranch-b72fe3e67e65c66d979a9651ebc815bdc553601c.tar.bz2
ranch-b72fe3e67e65c66d979a9651ebc815bdc553601c.zip
Introduce the ranch_server registry, make it handle listeners
Diffstat (limited to 'src/ranch_listener_sup.erl')
-rw-r--r--src/ranch_listener_sup.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ranch_listener_sup.erl b/src/ranch_listener_sup.erl
index 63e3ffe..b42732d 100644
--- a/src/ranch_listener_sup.erl
+++ b/src/ranch_listener_sup.erl
@@ -17,21 +17,22 @@
-behaviour(supervisor).
%% API.
--export([start_link/5]).
+-export([start_link/6]).
%% supervisor.
-export([init/1]).
%% API.
--spec start_link(non_neg_integer(), module(), any(), module(), any())
+-spec start_link(any(), non_neg_integer(), module(), any(), module(), any())
-> {ok, pid()}.
-start_link(NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) ->
+start_link(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) ->
MaxConns = proplists:get_value(max_connections, TransOpts, 1024),
{ok, SupPid} = supervisor:start_link(?MODULE, []),
{ok, ListenerPid} = supervisor:start_child(SupPid,
{ranch_listener, {ranch_listener, start_link, [MaxConns, ProtoOpts]},
permanent, 5000, worker, [ranch_listener]}),
+ ok = ranch_server:insert_listener(Ref, ListenerPid),
{ok, ConnsPid} = supervisor:start_child(SupPid,
{ranch_conns_sup, {ranch_conns_sup, start_link, []},
permanent, 5000, supervisor, [ranch_conns_sup]}),