closing connection on wsbus terminate

This commit is contained in:
Umgeher Torgersen 2024-11-28 17:21:37 +00:00
parent 918de5941b
commit 5ff6b28bcf

View file

@ -42,7 +42,7 @@ websocket_info({send, <<Bin/binary>>}, S) ->
websocket_info({send, List}, S) when is_list(List) ->
{List, S};
websocket_info({'DOWN', _, process, PID, _}, #{wsbus := PID} = S) ->
{ok, S#{wsbus => nil, ref_wsbus => st:lookup(wsbus)}};
{[close], S};
websocket_info({_, {send, _} = Msg}, S) ->
websocket_info(Msg, S);
websocket_info({_, {Ref, {error, notfound}}}, #{ref_wsbus := Ref} = S) ->