26 instantiations of PersistentPortAllocationKey
Aspire.Hosting (3)
Dcp\DcpExecutor.cs (1)
825
return new
PersistentPortAllocationKey
(resource.Name, endpoint.Name);
Dcp\PersistentPortAllocationStore.cs (1)
99
allocations[new
PersistentPortAllocationKey
(resource.Key, endpoint.Key)] = publicPort;
Dcp\PersistentPortAllocator.cs (1)
142
var publicPortKey = new
PersistentPortAllocationKey
(resource.Name, endpoint.Name);
Aspire.Hosting.Tests (23)
Dcp\AppHostLocalStateStoreTests.cs (11)
25
var firstKey = new
PersistentPortAllocationKey
("first", "http");
26
var secondKey = new
PersistentPortAllocationKey
("second", "http");
53
store.SetPort(new
PersistentPortAllocationKey
("Program", "HTTP"), 12001);
55
var equivalentKey = new
PersistentPortAllocationKey
("program", "http");
82
portAllocationStore.SetPort(new
PersistentPortAllocationKey
("first", "http"), 12001);
92
portAllocationStore.SetPort(new
PersistentPortAllocationKey
("second", "http"), 12002);
116
portAllocationStore.SetPort(new
PersistentPortAllocationKey
("first", "http"), 12001);
141
portAllocationStore.SetPort(new
PersistentPortAllocationKey
("first", "http"), 12001);
169
var key = new
PersistentPortAllocationKey
("program", "http");
185
var firstKey = new
PersistentPortAllocationKey
("first", "http");
186
var secondKey = new
PersistentPortAllocationKey
("second", "http");
Dcp\DcpExecutorTests.cs (12)
1656
Assert.Equal(allocatedPort, allocations[new
PersistentPortAllocationKey
("CoolProgram", "http")]);
1700
Assert.Equal(allocatedPort, allocations[new
PersistentPortAllocationKey
("database", "http")]);
1896
Assert.Equal(persistedPort, allocations[new
PersistentPortAllocationKey
("PersistentProgram", "http")]);
1897
Assert.Equal(allocatedPort, allocations[new
PersistentPortAllocationKey
("DynamicProgram", "http")]);
1911
var portKey = new
PersistentPortAllocationKey
("PersistentProgram", "http");
1963
var storedPortKey = new
PersistentPortAllocationKey
("StoredProgram", "http");
2010
var portKey = new
PersistentPortAllocationKey
("PersistentProgram", "http");
2061
var portKey = new
PersistentPortAllocationKey
("Program", "http");
2123
new
PersistentPortAllocationKey
("FixedProgram", "http"),
2206
var portKey = new
PersistentPortAllocationKey
("PersistentProgram", "http");
2253
var portKey = new
PersistentPortAllocationKey
("PersistentProgram", "http");
2341
Assert.Equal(new
PersistentPortAllocationKey
("Program", "http"), allocation.Key);
27 references to PersistentPortAllocationKey
Aspire.Hosting (15)
Dcp\DcpExecutor.cs (3)
687
var
portKey = GetPersistentPublicPortKey(sp.ModelResource, endpoint);
810
var
portKey = GetPersistentPublicPortKey(resource, endpoint);
823
private static
PersistentPortAllocationKey
GetPersistentPublicPortKey(IResource resource, EndpointAnnotation endpoint)
Dcp\PersistentPortAllocationStore.cs (6)
19
public IReadOnlyDictionary<
PersistentPortAllocationKey
, int> GetAllocations()
24
new Dictionary<
PersistentPortAllocationKey
, int>());
27
public void SetPort(
PersistentPortAllocationKey
key, int port)
48
out Dictionary<
PersistentPortAllocationKey
, int> allocations)
120
private static JsonObject WritePortAllocations(Dictionary<
PersistentPortAllocationKey
, int> allocations)
152
public bool Equals(
PersistentPortAllocationKey
other) =>
Dcp\PersistentPortAllocator.cs (6)
22
private readonly Dictionary<
PersistentPortAllocationKey
, int> _reservedPorts = new();
43
public int GetOrAllocatePersistentPort(
PersistentPortAllocationKey
key, ProtocolType protocol)
74
private int? GetLegacyPort(
PersistentPortAllocationKey
key)
105
private static string GetLegacyConfigurationKey(
PersistentPortAllocationKey
key)
117
var activePortKeys = new Dictionary<
PersistentPortAllocationKey
, ActivePort>();
142
var
publicPortKey = new PersistentPortAllocationKey(resource.Name, endpoint.Name);
Aspire.Hosting.Tests (12)
Dcp\AppHostLocalStateStoreTests.cs (6)
25
var
firstKey = new PersistentPortAllocationKey("first", "http");
26
var
secondKey = new PersistentPortAllocationKey("second", "http");
55
var
equivalentKey = new PersistentPortAllocationKey("program", "http");
169
var
key = new PersistentPortAllocationKey("program", "http");
185
var
firstKey = new PersistentPortAllocationKey("first", "http");
186
var
secondKey = new PersistentPortAllocationKey("second", "http");
Dcp\DcpExecutorTests.cs (6)
1911
var
portKey = new PersistentPortAllocationKey("PersistentProgram", "http");
1963
var
storedPortKey = new PersistentPortAllocationKey("StoredProgram", "http");
2010
var
portKey = new PersistentPortAllocationKey("PersistentProgram", "http");
2061
var
portKey = new PersistentPortAllocationKey("Program", "http");
2206
var
portKey = new PersistentPortAllocationKey("PersistentProgram", "http");
2253
var
portKey = new PersistentPortAllocationKey("PersistentProgram", "http");