tcp_echo_app.erl 363 B

1234567891011121314151617181920
  1. %% Feel free to use, reuse and abuse the code in this file.
  2. %% @private
  3. -module(tcp_echo_app).
  4. -behaviour(application).
  5. %% API.
  6. -export([start/2]).
  7. -export([stop/1]).
  8. %% API.
  9. start(_Type, _Args) ->
  10. {ok, _} = ranch:start_listener(tcp_echo,
  11. ranch_tcp, #{socket_opts => [{port, 5555}]},
  12. echo_protocol, []),
  13. tcp_echo_sup:start_link().
  14. stop(_State) ->
  15. ok.