anchor.diff:      Specs2 = lists:foldl(
           fun(#nkconn{transp=Transp, ip=Ip, port=Port}=NkConn, Acc) ->
               ConnId = {Transp, Ip, Port},
  -            ConnSpec = #conn_spec{id=ConnId, nkconn=NkConn, pool=Pool, meta=Meta},
  +            ConnSpec = #conn_spec{
  +                id = ConnId,
  +                nkconn = NkConn,
  +                pool = Pool,
  +                max_exclusive = Max,
  +                meta=Meta
  +            },
               Acc#{ConnId => ConnSpec}
           end,
           Specs,
  
positive.code: 
  
  %% @private
  do_get_pid([Pid]) ->
      Pid;
  do_get_pid(Pids) ->
      lists:nth(rand:uniform(length(Pids)), Pids).
  
  
  %% @private
  do_get_exclusive_pid(Pids, {true, UserPid}, State) ->
      #state{conn_pids=ConnPids, conn_user_mons=Mons} = State,
      Pids2 = lists:filter(
          fun(Pid) ->
              case maps:get(Pid, ConnPids) of
                  {_ConnId, undefined} -> true;
                  {_ConnId, _OldRef} -> false
              end
          end,
          Pids),
      case Pids2 of
          [] ->
              false;
          _ ->
              Pid = do_get_pid(Pids2),
              {ConnId, undefined} = maps:get(Pid, ConnPids),
              Mon = monitor(process, UserPid),
              State2 = State#state{
                  conn_pids = ConnPids#{Pid => {ConnId, Mon}},
                  conn_user_mons = Mons#{Mon => Pid}
              },
              {ok, Pid, State2}
      end.
  
  
  %% @private
  
negative.code: %% in that case one of the connections is selected randomly. If not,
  %% a new connection is started
  %% If we cannot connect to a destination, is marked as failed and retried later
  %% You can also get an exclusive connection, that would be blocked for everyone else
  %% If none is available, new ones will be started (up to max_exclusive)
  %% You must release the connection to be reused, if the process fails it will stop
  %% @see nkpacket_httpc_pool for sample
  
  -module(nkpacket_pool).
  