anchor.diff:                                         | transport_opts(Transport, Opts)],
                                         Protocol, handler_opts(Protocol, Opts)).
   
  -listener_name(Port) ->
  -    list_to_atom("mqtt_" ++ integer_to_list(Port)).
  +listener_name(Ip, Port) ->
  +    {emqttd_listener, Ip, Port}.
   
   transport_opts(ranch_ssl, Opts) ->
       [{cacerts, case proplists:get_value(cafile, Opts) of
  
positive.code: maybe_change_listener(_, Old, New) when Old == New -> ok;
  maybe_change_listener(Transport, Old, New) ->
      lists:foreach(
        fun({{_,Port} = IpAddr, Opts}) ->
                case proplists:get_value(IpAddr, New) of
                    undefined ->
                        %% delete listener
                        ranch:stop_listener(listener_name(Port));
                    Opts -> ok; %% no change;
                    NewOpts ->
                        %% New Opts for existing listener
                        %% teardown listener and restart
                        %% TODO: improve!
                        ok = ranch:set_protocol_options(listener_name(Port), transport_opts(Transport, NewOpts))
                end
        end, Old).
  
  
negative.code:     [start_listener(Transport, Protocol, Addr, Port, Opts) || {{Addr, Port}, Opts} <- Listeners].
  
  start_listener(Transport, Protocol, Addr, Port, Opts) ->
      Ref = listener_name(Addr, Port),
      NrOfAcceptors = proplists:get_value(nr_of_acceptors, Opts),
      {ok, _Pid} = ranch:start_listener(Ref, NrOfAcceptors, Transport,
                                        [{ip, case is_list(Addr) of
  