From b400e34386ec0dc3f290da6c4671d7d0621d2fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 4 Jul 2018 10:57:05 +0200 Subject: Better distinguish between Ranch and socket options A map should now be used when specifying transport options that contain more than just socket options. It is still possible to pass a list of socket options directly as a convenience. The ack_timeout is renamed to handshake_timeout when specified as a map. This corresponds to the new function ranch:handshake/1,2 that will be favored in Ranch 2.0. Specifying Ranch-specific options via the proplist will no longer be possible starting from Ranch 2.0. --- test/shutdown_SUITE.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/shutdown_SUITE.erl') diff --git a/test/shutdown_SUITE.erl b/test/shutdown_SUITE.erl index d46e223..249458e 100644 --- a/test/shutdown_SUITE.erl +++ b/test/shutdown_SUITE.erl @@ -30,7 +30,7 @@ brutal_kill(_) -> doc("Shutdown Ranch listener with shutdown option set to brutal_kill."), Name = name(), {ok, ListenerSup} = ranch:start_listener(Name, - ranch_tcp, [{port, 0}, {shutdown, brutal_kill}], + ranch_tcp, #{shutdown => brutal_kill}, echo_protocol, []), Port = ranch:get_port(Name), {ok, _} = gen_tcp:connect("localhost", Port, []), @@ -50,7 +50,7 @@ infinity(_) -> doc("Shutdown Ranch listener with shutdown option set to infinity."), Name = name(), {ok, ListenerSup} = ranch:start_listener(Name, - ranch_tcp, [{port, 0}, {shutdown, infinity}], + ranch_tcp, #{shutdown => infinity}, echo_protocol, []), Port = ranch:get_port(Name), {ok, _} = gen_tcp:connect("localhost", Port, []), @@ -72,7 +72,7 @@ infinity_trap_exit(_) -> "until the protocol process terminates."), Name = name(), {ok, ListenerSup} = ranch:start_listener(Name, - ranch_tcp, [{port, 0}, {shutdown, infinity}], + ranch_tcp, #{shutdown => infinity}, trap_exit_protocol, []), Port = ranch:get_port(Name), {ok, _} = gen_tcp:connect("localhost", Port, []), @@ -101,7 +101,7 @@ timeout(_) -> doc("Shutdown Ranch listener with shutdown option set to 500ms."), Name = name(), {ok, ListenerSup} = ranch:start_listener(Name, - ranch_tcp, [{port, 0}, {shutdown, 500}], + ranch_tcp, #{shutdown => 500}, echo_protocol, []), Port = ranch:get_port(Name), {ok, _} = gen_tcp:connect("localhost", Port, []), @@ -123,7 +123,7 @@ timeout_trap_exit(_) -> "after the 500ms timeout."), Name = name(), {ok, ListenerSup} = ranch:start_listener(Name, - ranch_tcp, [{port, 0}, {shutdown, 500}], + ranch_tcp, #{shutdown => 500}, trap_exit_protocol, []), Port = ranch:get_port(Name), {ok, _} = gen_tcp:connect("localhost", Port, []), -- cgit v1.2.3