anchor.diff:              {error, Reason}
       end.
   
  -recv_binary(#handle{length=L}=H, Length) ->
  -    recv_binary(H, Length, L >= Length).
  -
   recv_binary(#handle{buf=B,start=S,length=L}=H, Length, true) ->
       {ok, binary_part(B,S,Length), H#handle{start = S+Length, length = L-Length}};
   recv_binary(#handle{buf=B,start=S,length=L}=H, Length, false) ->
  
positive.code:         {error, Reason} ->
              {error, Reason}
      end.
  
  recv_text(#handle{buf=B,start=S,length=L}=H, Pattern) ->
      Binary = binary_part(B, S, L),
      recv_text(H, Pattern, Binary, L, binary:match(Binary,Pattern)).
  
  recv_text(#handle{start=S}=H, _Pattern, Binary, Length, {MS,ML}) ->
      {ok, binary_part(Binary,0,MS), H#handle{start = S+(MS+ML), length = Length-(MS+ML)}};
  
negative.code: -export([connect/4, close/1]).
  -export([recv/1]).
  -export([recv/3, send/3]).
  -export([recv_binary/2, recv_text/2]).
  -export([remains/1]).
  -export([set_caps/2, set_version/2]).
  
  