Compare commits

..

No commits in common. "master" and "0.1.0" have entirely different histories.

2 changed files with 1 additions and 4 deletions

View file

@ -1,6 +1,6 @@
PROJECT = wsio
PROJECT_DESCRIPTION = WebSocket IO
PROJECT_VERSION = 0.2.0
PROJECT_VERSION = 0.1.0
# By default templates indent with a single tab per indentation
# level. Set this variable to the number of spaces you prefer:

View file

@ -40,12 +40,9 @@ websocket_info({send, <<Bin/binary>>}, S) ->
{[{text, Bin}], 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)}};
websocket_info({_, {Ref, {error, notfound}}}, #{ref_wsbus := Ref} = S) ->
{ok, S#{ref_wsbus => st:lookup(wsbus)}};
websocket_info({_, {Ref, {ok, PID}}}, #{ref_wsbus := Ref} = S) ->
erlang:monitor(process, PID),
{ok, maps:remove(ref_wsbus, S#{wsbus => PID})};
websocket_info(_, S) ->
{ok, S}.