anchor.diff:       "\r\n"].
   
   handle_result_fun(WSState) ->
  -    fun(Result, Acc) ->
  +    fun({FrameInfo, Result}, Acc) ->
               case Result of
                   {reply, {Type, Data}} ->
                       do_send(WSState, {Type, Data}),
  
positive.code:                                             CallbackMod:handle_message(M)
                                      end,
                                      BasicMessages),
                  {catch lists:foldl(handle_result_fun(WSState), ok, CallbackResults),
                   NewCallbackState0};
              {advanced,_} ->
                  catch lists:foldl(do_callback_fun(WSState, CallbackMod),
  
negative.code:                 noreply ->
                      Acc;
                  {close, Reason} ->
                      %% check if client sent a close, and if so, verify that the
                      %% close code is legal
                      NReason = check_close_code(FrameInfo, Reason),
                      throw({close, NReason})
              end
      end.
  
  