anchor.diff:  
   handle_info({Closed, Sock}, #state{sock = Sock} = State)
     when Closed == tcp_closed; Closed == ssl_closed ->
  -    %% TODO flush queue
  -    {stop, sock_closed, State};
  +    {stop, sock_closed, flush_queue(State, {error, sock_closed})};
   
   handle_info({Error, Sock, Reason}, #state{sock = Sock} = State)
     when Error == tcp_error; Error == ssl_error ->
  -    %% TODO flush queue
  -    {stop, {sock_error, Reason}, State};
  +    Why = {sock_error, Reason},
  +    {stop, Why, flush_queue(State, {error, Why})};
   
   handle_info({_, Sock, Data2}, #state{data = Data, sock = Sock} = State) ->
       loop(State#state{data = <<Data/binary, Data2/binary>>}).
  
positive.code:             end;
          true ->
              State#state{sync_required = true}
      end.
  
  to_binary(B) when is_binary(B) -> B;
  
negative.code:                   queue = queue:in(Req, Q),
                    async = Async}};
  
  handle_cast(stop, State) ->
      {stop, normal, flush_queue(State, {error, stop})};
  
  handle_cast(Req = {_, {squery, Sql}}, State) ->
      #state{queue = Q} = State,
  