From 109c63d0e76ca6248863932c7a9957f8093cfaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 1 Apr 2013 17:04:21 +0200 Subject: Remove ranch_listener and replace ListenerPid by Ref We just don't need this process anymore. Less, simpler code! API changes: * Protocols start_link first argument is now Ref instead of ListenerPid * ranch:accept_ack/1 argument is now Ref instead of ListenerPid * ranch_listener:remove_connection/1 becomes ranch:remove_connection/1 and its argument is now Ref instead of ListenerPid Ref is the name of the listener given as first argument to start_listener/6. --- src/ranch_listener_sup.erl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/ranch_listener_sup.erl') diff --git a/src/ranch_listener_sup.erl b/src/ranch_listener_sup.erl index 1d346aa..9f19123 100644 --- a/src/ranch_listener_sup.erl +++ b/src/ranch_listener_sup.erl @@ -28,18 +28,15 @@ -> {ok, pid()}. start_link(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) -> MaxConns = proplists:get_value(max_connections, TransOpts, 1024), + ranch_server:set_new_listener_opts(Ref, MaxConns, ProtoOpts), supervisor:start_link(?MODULE, { - Ref, NbAcceptors, MaxConns, Transport, TransOpts, Protocol, ProtoOpts + Ref, NbAcceptors, Transport, TransOpts, Protocol }). %% supervisor. -init({Ref, NbAcceptors, MaxConns, Transport, TransOpts, Protocol, ProtoOpts}) -> +init({Ref, NbAcceptors, Transport, TransOpts, Protocol}) -> ChildSpecs = [ - %% listener - {ranch_listener, {ranch_listener, start_link, - [Ref, MaxConns, ProtoOpts]}, - permanent, 5000, worker, [ranch_listener]}, %% conns_sup {ranch_conns_sup, {ranch_conns_sup, start_link, [Ref, Transport, Protocol]}, -- cgit v1.2.3