Просмотр исходного кода

Update examples to use new transport options format

juhlig 5 лет назад
Родитель
Сommit
90924f38ee
2 измененных файлов с 4 добавлено и 2 удалено
  1. 2 1
      examples/tcp_echo/src/tcp_echo_app.erl
  2. 2 1
      examples/tcp_reverse/src/tcp_reverse_app.erl

+ 2 - 1
examples/tcp_echo/src/tcp_echo_app.erl

@@ -12,7 +12,8 @@
 
 
 start(_Type, _Args) ->
 start(_Type, _Args) ->
 	{ok, _} = ranch:start_listener(tcp_echo,
 	{ok, _} = ranch:start_listener(tcp_echo,
-		ranch_tcp, [{port, 5555}], echo_protocol, []),
+		ranch_tcp, #{socket_opts => [{port, 5555}]},
+		echo_protocol, []),
 	tcp_echo_sup:start_link().
 	tcp_echo_sup:start_link().
 
 
 stop(_State) ->
 stop(_State) ->

+ 2 - 1
examples/tcp_reverse/src/tcp_reverse_app.erl

@@ -12,7 +12,8 @@
 
 
 start(_Type, _Args) ->
 start(_Type, _Args) ->
     {ok, _} = ranch:start_listener(tcp_reverse,
     {ok, _} = ranch:start_listener(tcp_reverse,
-		ranch_tcp, [{port, 5555}], reverse_protocol, []),
+		ranch_tcp, #{socket_opts => [{port, 5555}]},
+		reverse_protocol, []),
     tcp_reverse_sup:start_link().
     tcp_reverse_sup:start_link().
 
 
 stop(_State) ->
 stop(_State) ->