anchor.diff:  	receive upgraded -> ok after 1000 -> error(timeout) end,
   	ok = ranch:stop_listener(Name).
   
  -tcp_inherit_options(_) ->
  -	Name = tcp_inherit_options,
  -	TcpOptions = [{nodelay, false}, {send_timeout_close, false}],
  -	{ok, _} = ranch:start_listener(Name, 4, ranch_tcp,
  -			TcpOptions,
  -			check_tcp_options, [{pid, self()} | TcpOptions]),
  -	Port = ranch:get_port(Name),
  -	{ok, Socket} = gen_tcp:connect("localhost", Port,
  -			[binary, {active, true}, {packet, raw}]),
  -	receive checked -> ok after 1000 -> error(timeout) end,
  -	ok = gen_tcp:close(Socket),
  -	ok = ranch:stop_listener(Name).
  -
   %% Supervisor tests
  -
  -supervisor_clean_restart(_) ->
  -	%% There we verify that mature listener death will not let
  -	%% whole supervisor down and also the supervisor itself will
  -	%% restart everything properly.
  -	Name = supervisor_clean_restart,
  -	NbAcc = 4,
  -	{ok, Pid} = ranch:start_listener(Name,
  -		NbAcc, ranch_tcp, [], echo_protocol, []),
  -	%% Trace supervisor spawns.
  -	1 = erlang:trace(Pid, true, [procs, set_on_spawn]),
  -	ConnsSup0 = ranch_server:get_connections_sup(Name),
  -	erlang:exit(ConnsSup0, kill),
  -	receive after 1000 -> ok end,
  -	%% Verify that supervisor is alive
  -	true = is_process_alive(Pid),
  -	%% ...but children are dead.
  -	false = is_process_alive(ConnsSup0),
  -	%% Receive traces from newly started children
  -	ConnsSup = receive {trace, Pid, spawn, Pid2, _} -> Pid2 end,
  -	AccSupPid = receive {trace, Pid, spawn, Pid3, _} -> Pid3 end,
  -	%% ...and its acceptors.
  -	[receive {trace, AccSupPid, spawn, _Pid, _} -> ok end ||
  -		_ <- lists:seq(1, NbAcc)],
  -	%% No more traces then.
  -	receive
  -		{trace, EPid, spawn, _, _} when EPid == Pid; EPid == AccSupPid ->
  -			error(invalid_restart)
  -	after 1000 -> ok end,
  -	%% Verify that new children registered themselves properly.
  -	ConnsSup = ranch_server:get_connections_sup(Name),
  -	_ = erlang:trace(all, false, [all]),
  -	ok = clean_traces(),
  -	ok = ranch:stop_listener(Name).
   
   supervisor_clean_child_restart(_) ->
   	%% Then we verify that only parts of the supervision tree
  
positive.code: 	{_, 20} = lists:keyfind(workers, 1, Counts2),
  	ok = ranch:stop_listener(Name).
  
  tcp_set_max_connections(_) ->
  	Name = tcp_set_max_connections,
  	{ok, _} = ranch:start_listener(Name, 1,
  		ranch_tcp, [{max_connections, 10}],
  		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),
  	10 = receive_loop(connected, 1000),
  	10 = ranch:get_max_connections(Name),
  	ranch:set_max_connections(Name, 20),
  	10 = receive_loop(connected, 1000),
  	20 = ranch:get_max_connections(Name),
  	ok = ranch:stop_listener(Name).
  
  tcp_infinity_max_connections(_) ->
  	Name = tcp_infinity_max_connections,
  	{ok, _} = ranch:start_listener(Name, 1,
  		ranch_tcp, [{max_connections, 10}],
  		notify_and_wait_protocol, [{msg, connected}, {pid, self()}]),
  
negative.code: 	%% Make sure the listener stopped.
  	{'EXIT', _} = begin catch ranch:get_port(Name) end,
  	ok.
  
  tcp_inherit_options(_) ->
  	Name = tcp_inherit_options,
  	TcpOptions = [{nodelay, false}, {send_timeout_close, false}],
  	{ok, _} = ranch:start_listener(Name, 4, ranch_tcp,
  			TcpOptions,
  			check_tcp_options, [{pid, self()} | TcpOptions]),
  	Port = ranch:get_port(Name),
  	{ok, Socket} = gen_tcp:connect("localhost", Port,
  			[binary, {active, true}, {packet, raw}]),
  	receive checked -> ok after 1000 -> error(timeout) end,
  	ok = gen_tcp:close(Socket),
  	ok = ranch:stop_listener(Name).
  
  tcp_max_connections(_) ->
  	Name = tcp_max_connections,
  