anchor.diff:  -spec start(address(), portnum()) -> {ok, pid()} | {error, term()}.
   start(Address, Port) ->
       gen_server:start(?MODULE, [Address, Port], []).
  +
  +%% @doc Return true if connected to the remote server and {false, [{Reason,integer()}]}
  +%%      with a list of failed connect reasons
  +is_connected(Pid) ->
  +    gen_server:call(Pid, is_connected).
   
   %% @doc Ping the server
   -spec ping(pid()) -> ok | {error, term()}.
  
positive.code:                  %% Would really like this in a nested {setup, blah} structure
                   %% but eunit does not allow
                   {ok, Pid} = start_link(?TEST_IP, ?TEST_PORT),
                   pause_riak_pb_sockets(),
                   Me = self(),
                   %% this request will block as
                   spawn(fun() -> Me ! {1, ping(Pid, 0)} end),
                   %% this request should be queued as socket will not be created
                   spawn(fun() -> Me ! running, Me ! {2, ping(Pid, 0)} end),
                   receive running -> ok end,
                   resume_riak_pb_sockets(),
                   receive {1,Ping1} -> ?assertEqual({error, timeout}, Ping1) end,
                   receive {2,Ping2} -> ?assertEqual({error, timeout}, Ping2) end
               end)},
  
negative.code: -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
           terminate/2, code_change/3]).
  
  -define(PROTO_MAJOR, 1).
  -define(PROTO_MINOR, 0).
  -define(DEFAULT_TIMEOUT, 60000).
  -define(FIRST_RECONNECT_INTERVAL, 100).
  -define(MAX_RECONNECT_INTERVAL, 30000).
  
  -record(state, {address,    % address to connect to
                  port,       % port to connect to
                  sock,       % gen_tcp socket
                  pending,    % active request
                  queue,      % queue of pending requests
                  connects=0, % number of successful connects
                  failed=[],  % breakdown of failed connects
                  reconnect_interval=?FIRST_RECONNECT_INTERVAL}).
  -record(request, {ref :: reference(), msg :: rpb_req(), from, ctx :: ctx(), timeout :: integer(),
                    tref :: reference() | undefined }).
  
  -type address() :: string() | atom() | ip_address().
  -type portnum() :: non_neg_integer().
  