public T FindOrCreateActive(ushort eventId, QuicObjectKey key) { T?value; if (eventId == CreateEventId) { var old = RemoveActiveObject(key); if (old != null) { inactiveList.Add(old); } value = ObjectConstructor(key.Pointer, key.ProcessId); activeTable.Add(key, value); } else if (eventId == DestroyedEventId) { value = RemoveActiveObject(key); if (value != null) { inactiveList.Add(value); } } else { value = FindActive(key); } if (value is null) { value = ObjectConstructor(key.Pointer, key.ProcessId); activeTable.Add(key, value); } return(value); }
public T FindOrCreateActive(QuicObjectKey key) { T?value = FindActive(key); if (value is null) { value = ObjectConstructor(key.Pointer, key.ProcessId); activeTable.Add(key, value); } return(value); }
internal QuicConnection FindOrCreateConnection(QuicObjectKey key) { return(ConnectionSet.FindOrCreateActive(key)); }
internal QuicWorker FindOrCreateWorker(QuicObjectKey key) { return(WorkerSet.FindOrCreateActive(key)); }
public T?RemoveActiveObject(QuicObjectKey key) => activeTable.Remove(key, out var value) ? value : null;
public T?FindActive(QuicObjectKey key) => activeTable.TryGetValue(key, out var value) ? value : null;