anchor.diff:  
   -record(state, {address,    % address to connect to
                   port,       % port to connect to
  +                auto_reconnect = false, % if true, automatically reconnects to server
  +                                        % if false, exits on connection failure/request timeout
                   queue_if_disconnected = false, % if true, add requests to queue if disconnected
                   sock,       % gen_tcp socket
                   active,     % active request
  
positive.code:             gen_tcp:close(Sock)
      end,
  
      %% Schedule the reconnect message and return state
      erlang:send_after(State#state.reconnect_interval, self(), reconnect),
      increase_reconnect_interval(State#state{sock = undefined, active = undefined}).
   
  %% Double the reconnect interval up to the maximum
  increase_reconnect_interval(State) ->
      case State#state.reconnect_interval of
  
negative.code:             case Ref == Active#request.ref of
                  true ->  %% Matches the current operation
                      NewState = maybe_reply(on_timeout(State#state.active, State)),
                      disconnect(NewState#state{active = undefined});
                  false ->
                      {noreply, remove_queued_request(Ref, State)}
              end
      end;
  handle_info(reconnect, State) ->
      case connect(State) of
          {ok, NewState} ->
              {noreply, dequeue_request(NewState)};
          {error, Reason} ->
              %% Update the failed count and reschedule a reconnection
              NewState = State#state{failed = orddict:update_counter(Reason, 1, State#state.failed)},
              disconnect(NewState)
      end;
  handle_info(_, State) ->
      {noreply, State}.            
  
  %% @private
  handle_cast(_Msg, State) ->
  