|
@@ -916,7 +916,7 @@ tcp_max_connections(_) ->
|
|
|
Name = name(),
|
|
|
{ok, _} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{max_connections => 10, num_acceptors => 1},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self()}),
|
|
|
Port = ranch:get_port(Name),
|
|
|
ok = connect_loop(Port, 11, 150),
|
|
|
10 = ranch_server:count_connections(Name),
|
|
@@ -956,7 +956,7 @@ tcp_max_connections_infinity(_) ->
|
|
|
Name = name(),
|
|
|
{ok, _} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{max_connections => 10, num_acceptors => 1},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self()}),
|
|
|
Port = ranch:get_port(Name),
|
|
|
ok = connect_loop(Port, 20, 0),
|
|
|
10 = ranch_server:count_connections(Name),
|
|
@@ -989,7 +989,7 @@ tcp_set_max_connections(_) ->
|
|
|
Name = name(),
|
|
|
{ok, _} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{max_connections => 10, num_acceptors => 1},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self()}),
|
|
|
Port = ranch:get_port(Name),
|
|
|
ok = connect_loop(Port, 20, 0),
|
|
|
10 = ranch_server:count_connections(Name),
|
|
@@ -1011,7 +1011,7 @@ do_tcp_set_max_connections_clean(_) ->
|
|
|
Name = name(),
|
|
|
{ok, ListSupPid} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{max_connections => 4},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self()}),
|
|
|
Children = supervisor:which_children(ListSupPid),
|
|
|
{_, AccSupPid, _, _} = lists:keyfind(ranch_acceptors_sup, 1, Children),
|
|
|
1 = erlang:trace(ListSupPid, true, [procs]),
|
|
@@ -1069,11 +1069,11 @@ tcp_upgrade(_) ->
|
|
|
Name = name(),
|
|
|
{ok, _} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self()}),
|
|
|
Port = ranch:get_port(Name),
|
|
|
ok = connect_loop(Port, 1, 0),
|
|
|
receive connected -> ok after 1000 -> error(timeout) end,
|
|
|
- ranch:set_protocol_options(Name, [{msg, upgraded}, {pid, self()}]),
|
|
|
+ ranch:set_protocol_options(Name, #{msg => upgraded, pid => self()}),
|
|
|
ok = connect_loop(Port, 1, 0),
|
|
|
receive upgraded -> ok after 1000 -> error(timeout) end,
|
|
|
ok = ranch:stop_listener(Name).
|
|
@@ -1162,7 +1162,7 @@ do_supervisor_n_acceptors_m_conns_sups(NumAcceptors, NumConnsSups) ->
|
|
|
Name = name(),
|
|
|
{ok, Pid} = ranch:start_listener(Name,
|
|
|
ranch_tcp, #{num_conns_sups => NumConnsSups, num_acceptors => NumAcceptors},
|
|
|
- notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
|
|
|
+ notify_and_wait_protocol, #{msg => connected, pid => self(), timeout => 10000}),
|
|
|
Port = ranch:get_port(Name),
|
|
|
ConnsSups = [ConnsSup || {_, ConnsSup} <- ranch_server:get_connections_sups(Name)],
|
|
|
NumConnsSups = length(ConnsSups),
|