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

fix(connection): start connection failed

Shawn 4 лет назад
Родитель
Сommit
a884d215e1
4 измененных файлов с 5 добавлено и 4 удалено
  1. 1 1
      apps/emqx/rebar.config
  2. 2 1
      apps/emqx/src/emqx_connection.erl
  3. 1 1
      apps/emqx/src/emqx_listeners.erl
  4. 1 1
      rebar.config

+ 1 - 1
apps/emqx/rebar.config

@@ -12,7 +12,7 @@
     [ {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}
     , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}
     , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}}
-    , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}}
+    , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.1"}}}
     , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.10.2"}}}
     , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}}
     , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v4.0.1"}}} %% todo delete when plugins use hocon

+ 2 - 1
apps/emqx/src/emqx_connection.erl

@@ -106,6 +106,7 @@
         }).
 
 -type(state() :: #state{}).
+-type(opts() :: #{zone := atom(), listener := atom(), atom() => term()}).
 
 -define(ACTIVE_N, 100).
 -define(INFO_KEYS, [socktype, peername, sockname, sockstate, active_n]).
@@ -134,7 +135,7 @@
                             , system_code_change/4
                             ]}).
 
--spec(start_link(esockd:transport(), esockd:socket(), proplists:proplist())
+-spec(start_link(esockd:transport(), esockd:socket(), opts())
       -> {ok, pid()}).
 start_link(Transport, Socket, Options) ->
     Args = [self(), Transport, Socket, Options],

+ 1 - 1
apps/emqx/src/emqx_listeners.erl

@@ -72,7 +72,7 @@ console_print(_Fmt, _Args) -> ok.
       -> {ok, pid()} | {error, term()}).
 do_start_listener(ZoneName, ListenerName, #{type := tcp, bind := ListenOn} = Opts) ->
     esockd:open(listener_id(ZoneName, ListenerName), ListenOn, merge_default(esockd_opts(Opts)),
-                {emqx_connection, start_link, [ZoneName, ListenerName]});
+                {emqx_connection, start_link, [{ZoneName, ListenerName}]});
 
 %% Start MQTT/WS listener
 do_start_listener(ZoneName, ListenerName, #{type := ws, bind := ListenOn} = Opts) ->

+ 1 - 1
rebar.config

@@ -39,7 +39,7 @@
     , {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}
     , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}
     , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}}
-    , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}}
+    , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.1"}}}
     , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.10.2"}}}
     , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}}
     , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v4.0.1"}}} % TODO: delete when all apps moved to hocon