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: 
  -spec recv(handle(),non_neg_integer()|binary:cp(),boolean())
            -> {ok,binary(),handle()}|{error,_}.
  recv(Handle, Term, false)
    when is_integer(Term) ->
      recv_binary(Handle, Term);
  recv(Handle, Term, false) ->
      recv_text(Handle, Term).
  
  -spec recv_binary(handle(),non_neg_integer()) -> {ok,binary(),handle()}|{error,_}.
  recv_binary(#handle{length=L}=H, Length) ->
      recv_binary(H, Length, L >= Length).
  
  -spec recv_text(handle(),binary()) -> {ok,binary(),handle()}|{error,_}.
  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)).
  
  -spec send(handle(),binary(),boolean()) -> {ok,handle()}|{error,_}.
  send(#handle{}=H, Binary, Compress) ->
  