anchor.diff:  
   -behaviour(gen_server).
   
  +-include("ns_common.hrl").
  +
   %% gen_server API
   -export([start_link/0]).
   -export([init/1, handle_call/3, handle_cast/2,
            handle_info/2, terminate/2, code_change/3]).
   
  --record(state, {sock}).
  +-record(state, {sock::port()}).
   
   %% external API
   -export([connected/0, connected/1,
  
positive.code:         Response -> Response
      end.
  
  %% Internal functions
  call(Node, Call) ->
      gen_server:call({?MODULE, Node}, Call).
  
  do_in_bucket(_Sock, Bucket, Fun) ->
      %% TODO: real multi-tenancy
  
negative.code: %% gen_server API implementation
  
  start_link() ->
      %% Use proc_lib so that start_link doesn't fail if we can't
      %% connect.
      proc_lib:start_link(?MODULE, init, [[]]).
  
  
  %% gen_server callback implementation
  
  init([]) ->
      proc_lib:init_ack({ok, self()}),
      connect().
  
  handle_call({create_bucket, _Bucket, _Config}, _From, State) ->
      Reply = unimplemented,
      {reply, Reply, State};
  handle_call({delete_bucket, _Bucket}, _From, State) ->
      Reply = unimplemented,
      {reply, Reply, State};
  handle_call({delete_vbucket, Bucket, VBucket}, _From,
              #state{sock=Sock} = State) ->
      Reply = do_in_bucket(Sock, Bucket,
                          fun() ->
                                  mc_client_binary:delete_vbucket(
                                    Sock, VBucket)
                          end),
      {reply, Reply, State};
  handle_call(list_buckets, _From, State) ->
      Reply = {ok, ["default"]},
      {reply, Reply, State};
  handle_call({set_vbucket_state, Bucket, VBucket, VBState}, _From,
              #state{sock=Sock} = State) ->
      Reply = do_in_bucket(Sock, Bucket,
                           fun() ->
                                   mc_client_binary:set_vbucket_state(
                                     Sock, VBucket,
                                     atom_to_list(VBState))
                           end),
      {reply, Reply, State};
  handle_call({stats, Bucket, Key}, _From, #state{sock=Sock} = State) ->
      Reply = do_in_bucket(Sock, Bucket,
                           fun () ->
                                   mc_client_binary:stats(Sock, Key)
                           end),
      {reply, Reply, State}.
  
  
  handle_cast(unhandled, unhandled) ->
      unhandled.
  
  
  handle_info(Msg, State) ->
      ?log_info("handle_info(~p, ~p)", [Msg, State]),
      {noreply, State}.
  
  
  terminate(Reason, State) ->
      error_logger:error_msg("~p:terminate(~p, ~p)~n",
  