anchor.diff:   when ?is_transport(Prot) ->
      {next_state, 'CLIENT', State};
   
  -'CLIENT'({Prot, _Sock, {terminated, Reason}}, Pipe, State)
  - when ?is_transport(Prot) ->
  -   pipe:a(Pipe, {ws, self(), {terminated, Reason}}),
  +'CLIENT'({Prot, _Sock, eof}, Pipe, State)
  + when ?is_transport(Prot) ->
  +   pipe:a(Pipe, {ws, self(), eof}),
  +   {stop, normal, State};
  +
  +'CLIENT'({Prot, _Sock, {error, _} = Error}, Pipe, State)
  + when ?is_transport(Prot) ->
  +   pipe:a(Pipe, {ws, self(), Error}),
      {stop, normal, State};
   
   %%
  
positive.code:       {next_state, 'CLIENT', State#fsm{stream = Stream#stream{send = Send}}}
     catch _:Reason ->
        ?NOTICE("knet [ws]: failure ~p ~p", [Reason, erlang:get_stacktrace()]),
        pipe:b(Pipe, {ws, self(), {terminated, Reason}}),
        {stop, Reason, State}
     end.
  
  
negative.code:  when ?is_transport(Prot), is_binary(Pckt) ->
     case ws_recv(Pckt, Pipe, State#fsm.stream) of
        {eof, Stream} ->
           pipe:b(Pipe, {ws, self(), eof}),
           {stop, normal, State#fsm{stream=Stream}};
        {_,   Stream} ->
           {next_state, 'ESTABLISHED', State#fsm{stream=Stream}}
  