Add websocket_info to match {stop, Reason} msg

This commit is contained in:
GilbertWong 2019-06-14 16:22:57 +08:00
parent 1d88f8fd9e
commit 19822c15bd
1 changed files with 4 additions and 1 deletions

View File

@ -290,6 +290,9 @@ websocket_info({binary, Data}, State) ->
websocket_info({shutdown, Reason}, State) ->
shutdown(Reason, State);
websocket_info({stop, Reason}, State) ->
{stop, State#state{shutdown = Reason}};
websocket_info(Info, State) ->
?LOG(error, "[WS Channel] Unexpected info: ~p", [Info]),
{ok, State}.
@ -336,7 +339,7 @@ ensure_stats_timer(State) ->
shutdown(Reason, State) ->
%% Fix the issue#2591(https://github.com/emqx/emqx/issues/2591#issuecomment-500278696)
self() ! {stop, State#state{shutdown = Reason}},
self() ! {stop, Reason},
{ok, State}.
wsock_stats() ->