anchor.diff:          true -> 
               handle_data(<<>>, nolength, T, Socket, Context);
           false ->
  -    	    {Length, LenBytes} = unpack_length(T),
  -    	    <<_:LenBytes/bytes, Rest:Length/bytes>> = T,
  -    	    handle_data(<<>>, Length, Rest, Socket, Context)
  +            {Length, LenBytes} = unpack_length(T),
  +            <<_:LenBytes/bytes, Rest:Length/bytes>> = T,
  +            handle_data(<<>>, Length, Rest, Socket, Context)
       end;
   
   %% Extract frame ending with 255
   handle_data(none, nolength, <<>>, Socket, Context) ->
       resource_websocket:loop(none, nolength, Socket, Context);
  +handle_data(<<>>, nolength, <<255,_T/binary>>, _Socket, _Context) ->
  +    % A packet of <<0,255>> signifies that the ua wants to close the connection
  +    ua_close_request;
   handle_data(Msg, nolength, <<255,T/binary>>, Socket, Context) ->
       handle_message(Msg, Context),
       handle_data(none, nolength, T, Socket, Context);
  
positive.code:     B_v = B band 16#7F,
      NewLength = (Length * 128) + B_v,
      case B band 16#80 of
  	16#80 ->
  	    unpack_length(Binary, LenBytes + 1, NewLength);
  	0 ->
  	    {NewLength, LenBytes + 1}
      end.
  
  %% @doc Pack the length in 7 bits bytes
  
negative.code:         {error, closed} -> closed;
          _ -> exit(normal)
      end.
  
  
  %% Process a key from the websockey handshake, return an integere
  %% @spec process_key(string()) -> integer
  process_key(L) ->
      {Number,Spaces} = split_key(L, [], 0),
      Number div Spaces.
  
      split_key([], DAcc, Spaces) ->
          {list_to_integer(lists:reverse(DAcc)), Spaces};
      split_key([C|Rest], DAcc, Spaces) when C >= $0, C =< $9 ->
          split_key(Rest, [C|DAcc], Spaces);
      split_key([32|Rest], DAcc, Spaces) ->
          split_key(Rest, DAcc, Spaces+1);
      split_key([_|Rest], DAcc, Spaces) ->
          split_key(Rest, DAcc, Spaces).
  
  
  
  