anchor.diff:  -define(SERVER, ?MODULE).
   -define(TIMEOUT, 30000).
   
  --record(state, {sock, caller, req_type, reqid, dest}).
  +-record(state, {sock, caller, req_type, reqid, dest,
  +                reply_to}). % process to reply to for delayed call() replies
   
   close(ConnPid) ->
       gen_server:call(ConnPid, close_conn).
  
positive.code: handle_call(close_conn, _From, State) ->
      {stop, normal, ok, State};
  
  handle_call({index, IndexRec}, _From, #state{sock=Sock}=State) ->
      Data = raptor_pb:encode_index(IndexRec),
      gen_tcp:send(Sock, Data),
      inet:setopts(Sock, [{active, once}]),
      {reply, {ok, indexed}, State#state{req_type=index}, ?RECV_TIMEOUT};
  
  handle_call({deleteentry, DeleteEntryRec}, _From, #state{sock=Sock}=State) ->
      Data = raptor_pb:encode_deleteentry(DeleteEntryRec),
  
negative.code: 
  handle_info({tcp, Sock, _Data}, #state{req_type=index}=State) ->
      inet:setopts(Sock, [{active, once}]),
      gen_server:reply(State#state.reply_to, {ok, indexed}), 
      {noreply, State#state{req_type=undefined, reqid=undefined, 
                            dest=undefined, reply_to=undefined}};
  
  %%
  %% for now, stream and multistream returns protobuf messages exactly the same as stream
  