void FromAdapter_AddClient(Guid[] clientId) { foreach (var client in clientId) { if (client != this.clientId && clientTable.Get(client) == null) { clientTable.AddOrUpdate(client); if (isStarted) { RemoteClientUpdated?.Invoke(this, new ClientWithVirtualHostSettingEventArgs(client, Guid.Empty, null)); } } } }
void OnHelloReceived() { foreach (var client in clients) { var setting = clientTable.Get(client.Key); if (client.Value == Guid.Empty) { SendingRefreshClient(client.Key, null); } else { SendingRefreshClient(client.Key, BuildSettingData(client.Value, setting.VirtualHosts)); } } }
/// <inheritdoc/> public bool TryGetVirtualHosts(Guid clientId, out KeyValuePair <Guid, VirtualHostSetting>[] settings) { var entity = clientTable.Get(clientId); if (entity == null) { settings = default; return(false); } else { if (entity.IsVirtualHostsDisabled) { settings = default; } else { settings = entity.GetVirtualHosts(); } return(true); } }