aboutsummaryrefslogtreecommitdiffstats
path: root/test/remove_conn_and_wait_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-04-01 17:04:21 +0200
committerLoïc Hoguin <[email protected]>2013-04-01 17:04:21 +0200
commit109c63d0e76ca6248863932c7a9957f8093cfaf2 (patch)
tree12682f0ec90e57a31ef2e35d67e5440aa0335edb /test/remove_conn_and_wait_protocol.erl
parent33db3b0d1aafcfbc9aadbad622a4014c021ef10c (diff)
downloadranch-109c63d0e76ca6248863932c7a9957f8093cfaf2.tar.gz
ranch-109c63d0e76ca6248863932c7a9957f8093cfaf2.tar.bz2
ranch-109c63d0e76ca6248863932c7a9957f8093cfaf2.zip
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.
Diffstat (limited to 'test/remove_conn_and_wait_protocol.erl')
-rw-r--r--test/remove_conn_and_wait_protocol.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/remove_conn_and_wait_protocol.erl b/test/remove_conn_and_wait_protocol.erl
index 6a5b52a..6c8206c 100644
--- a/test/remove_conn_and_wait_protocol.erl
+++ b/test/remove_conn_and_wait_protocol.erl
@@ -4,15 +4,15 @@
-export([start_link/4]).
-export([init/2]).
-start_link(ListenerPid, _, _, [{remove, MaybeRemove}]) ->
- Pid = spawn_link(?MODULE, init, [ListenerPid, MaybeRemove]),
+start_link(Ref, _, _, [{remove, MaybeRemove}]) ->
+ Pid = spawn_link(?MODULE, init, [Ref, MaybeRemove]),
{ok, Pid}.
-init(ListenerPid, MaybeRemove) ->
- ranch:accept_ack(ListenerPid),
+init(Ref, MaybeRemove) ->
+ ranch:accept_ack(Ref),
case MaybeRemove of
true ->
- ranch_listener:remove_connection(ListenerPid);
+ ranch:remove_connection(Ref);
false ->
ok
end,