aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_server.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-04-02 17:10:15 +0200
committerLoïc Hoguin <[email protected]>2013-04-02 17:10:15 +0200
commit8203188155aa9243a4cdcec4962d9b190d2acb5b (patch)
tree273af2a4069f1aa6d9252b2ae8ffcb28d203738e /src/ranch_server.erl
parentce81cca5c834b0671af5c40e29462823997f445e (diff)
parentbb9f91b8658ab304a7038bcbca80dd518f53e026 (diff)
downloadranch-8203188155aa9243a4cdcec4962d9b190d2acb5b.tar.gz
ranch-8203188155aa9243a4cdcec4962d9b190d2acb5b.tar.bz2
ranch-8203188155aa9243a4cdcec4962d9b190d2acb5b.zip
Merge branch 'server-state-recover' of git://github.com/fishcakez/ranch
Diffstat (limited to 'src/ranch_server.erl')
-rw-r--r--src/ranch_server.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ranch_server.erl b/src/ranch_server.erl
index d827ae2..7557d53 100644
--- a/src/ranch_server.erl
+++ b/src/ranch_server.erl
@@ -114,7 +114,9 @@ count_connections(Ref) ->
%% @private
init([]) ->
- {ok, #state{}}.
+ Monitors = [{{erlang:monitor(process, Pid), Pid}, Ref} ||
+ [Ref, Pid] <- ets:match(?TAB, {{conns_sup, '$1'}, '$2'})],
+ {ok, #state{monitors=Monitors}}.
%% @private
handle_call({set_new_listener_opts, Ref, MaxConns, Opts}, _, State) ->