anchor.diff:  -define(APP, ?MODULE).
   -define(TCP_OPTS, [binary, {packet, raw}, {reuseaddr, true}, {nodelay, true}]).
   
  +-type(listener() :: {esockd:proto(), esockd:listen_on(), [esockd:option()]}).
  +
   %%--------------------------------------------------------------------
   %% Application callbacks
   %%--------------------------------------------------------------------
   
   start(_StartType, _StartArgs) ->
       {ok, Sup} = supervisor:start_link({local, emqx_stomp_sup}, ?MODULE, []),
  -    start_listener(),
  +    start_listeners(),
       {ok, Sup}.
   
   stop(_State) ->
  -    stop_listener().
  +    stop_listeners().
   
   %%--------------------------------------------------------------------
   %% Supervisor callbacks
  
positive.code: %% Start/Stop listeners
  %%--------------------------------------------------------------------
  
  start_listener() ->
      {ok, {Port, Opts}} = application:get_env(?APP, listener),
      {ok, Env} = application:get_env(?APP, frame),
      MFArgs = {emqx_stomp_connection, start_link, [Env]},
      esockd:open(stomp, Port, merge_opts(Opts), MFArgs).
  
  merge_opts(Opts) ->
      TcpOpts = emqx_misc:merge_opts(
                   ?TCP_OPTS, proplists:get_value(tcp_options, Opts, [])),
      emqx_misc:merge_opts(Opts, [{tcp_options, TcpOpts}]).
  
  stop_listener() ->
      {ok, {Port, _Opts}} = application:get_env(?APP, listener),
      esockd:close({stomp, Port}).
  
  
negative.code:         , stop/1
          ]).
  
  -export([ start_listeners/0
          , start_listener/1
          , start_listener/3
          , stop_listeners/0
          , stop_listener/1
          , stop_listener/3
          ]).
  
  -export([init/1]).
  