diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ranch_acceptor.erl | 7 | ||||
-rw-r--r-- | src/ranch_acceptors_sup.erl | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/ranch_acceptor.erl b/src/ranch_acceptor.erl index 935ec5c..cb34d75 100644 --- a/src/ranch_acceptor.erl +++ b/src/ranch_acceptor.erl @@ -14,12 +14,13 @@ -module(ranch_acceptor). --export([start_link/4]). +-export([start_link/5]). -export([loop/5]). --spec start_link(inet:socket(), module(), module(), pid()) +-spec start_link(ranch:ref(), non_neg_integer(), inet:socket(), module(), module()) -> {ok, pid()}. -start_link(LSocket, Transport, Logger, ConnsSup) -> +start_link(Ref, AcceptorId, LSocket, Transport, Logger) -> + ConnsSup = ranch_server:get_connections_sup(Ref, AcceptorId), MonitorRef = monitor(process, ConnsSup), Pid = spawn_link(?MODULE, loop, [LSocket, Transport, Logger, ConnsSup, MonitorRef]), {ok, Pid}. diff --git a/src/ranch_acceptors_sup.erl b/src/ranch_acceptors_sup.erl index e320633..f96b19b 100644 --- a/src/ranch_acceptors_sup.erl +++ b/src/ranch_acceptors_sup.erl @@ -43,7 +43,7 @@ init([Ref, NumAcceptors, Transport]) -> ranch_server:set_addr(Ref, Addr), Procs = [ {{acceptor, self(), N}, {ranch_acceptor, start_link, [ - LSocket, Transport, Logger, ranch_server:get_connections_sup(Ref, N) + Ref, N, LSocket, Transport, Logger ]}, permanent, brutal_kill, worker, []} || N <- lists:seq(1, NumAcceptors)], {ok, {{one_for_one, 1, 5}, Procs}}. |