Browse Source

Update examples to use new transport options format

juhlig 5 years ago
parent
commit
90924f38ee

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

@@ -12,7 +12,8 @@
 
 start(_Type, _Args) ->
 	{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().
 
 stop(_State) ->

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

@@ -12,7 +12,8 @@
 
 start(_Type, _Args) ->
     {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().
 
 stop(_State) ->