anchor.diff:  %% your socket receive buffer.
   %%
   %% -> { #ws_state, [#ws_frame_info,...,#ws_frame_info] }
  -unframe(_WSState, <<>>, _Opts) ->
  -    [];
   unframe(WSState, FirstPacket, Opts) ->
  +    unframe(WSState, FirstPacket, Opts, []).
  +
  +unframe(_WSState, <<>>, _Opts, Acc) ->
  +    {lists:reverse(Acc), <<>>};
  +unframe(WSState, FirstPacket, Opts, Acc) ->
       case unframe_one(WSState, FirstPacket, Opts) of
           {FrameInfo = #ws_frame_info{ws_state = NewWSState}, RestBin} ->
               %% Every new recursion uses the #ws_state from the calling
               %% recursion.
  -            [FrameInfo | unframe(NewWSState, RestBin, Opts)];
  +            unframe(NewWSState, RestBin, Opts, [FrameInfo | Acc]);
           frame_incomplete ->
  -            [{frame_incomplete, FirstPacket}];
  +            {lists:reverse(Acc), FirstPacket};
           Fail ->
  -            [Fail]
  +            {lists:reverse([Fail | Acc]), <<>>}
       end.
   
   %% -> {#ws_frame_info, RestBin} | {fail_connection, Reason}
  
positive.code:             end
      end.
  
  last_ws_state([#ws_frame_info{ws_state=State}|Rest], _LastState) ->
      last_ws_state(Rest, State);
  last_ws_state([], LastState) ->
      LastState;
  last_ws_state([{frame_incomplete, _}], LastState) ->
      LastState.
  
  handle_callback(Type, [#state{cbinfo=CbInfo}=State | Args]) ->
      Cb = case Type of
  
negative.code:     basic_messages(FrameInfos, State, State#state.timeout).
  
  basic_messages([], State, Tout) ->
      {ok, State, Tout};
  basic_messages([FrameInfo|Rest],
                 #state{cbinfo=CbInfo, cbstate={FrameState,CbState}}=State,
                 Tout) ->
  