fix
This commit is contained in:
parent
d4419aa36a
commit
261477ba86
@ -37,7 +37,7 @@ start_tcp_server() ->
|
||||
binary,
|
||||
{reuseaddr, true},
|
||||
{active, false},
|
||||
{packet, 2},
|
||||
{packet, 4},
|
||||
{nodelay, false},
|
||||
{backlog, Backlog}
|
||||
]},
|
||||
|
||||
@ -27,7 +27,7 @@ start_link() ->
|
||||
%% modules => modules()} % optional
|
||||
init([]) ->
|
||||
SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600},
|
||||
Specs = [
|
||||
Specs0 = [
|
||||
#{
|
||||
id => 'iot_device_sup',
|
||||
start => {'iot_device_sup', start_link, []},
|
||||
@ -47,7 +47,7 @@ init([]) ->
|
||||
}
|
||||
],
|
||||
|
||||
{ok, {SupFlags, pools() ++ Specs}}.
|
||||
{ok, {SupFlags, pools() ++ []}}.
|
||||
|
||||
%% internal functions
|
||||
|
||||
|
||||
@ -157,6 +157,13 @@ handle_info({binary, <<?PACKET_PUBLISH_RESPONSE, PacketId:32, Body/binary>>}, St
|
||||
{ok, State#state{inflight = NInflight}}
|
||||
end;
|
||||
|
||||
handle_info({tcp, Socket, Data}, State = #state{transport = Transport, socket = Socket}) ->
|
||||
lager:debug("[ws_channel] socket: ~p, get a message: ~p", [Socket, Data]),
|
||||
|
||||
Transport:send(Socket, <<"hello world reply">>),
|
||||
|
||||
{noreply, State};
|
||||
|
||||
handle_info(Info, State) ->
|
||||
lager:error("[ws_channel] get a unknown message: ~p, channel will closed", [Info]),
|
||||
{stop, State};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user