public static async Task <BootstrapServers> Instance() { if (_Instance == null) { _Instance = await Load(); } return(_Instance); }
private static async Task <BootstrapServers> Load() { BootstrapServers returnValue = null; try { byte[] downloadedData; using (WebClient webClient = new WebClient()) { downloadedData = await webClient.DownloadDataTaskAsync(ServerAddress); } string json = Encoding.UTF8.GetString(downloadedData); returnValue = JsonConvert.DeserializeObject <BootstrapServers>(json); } catch { returnValue = new BootstrapServers(); } returnValue.Save(); return(returnValue); }
private async void SetupBootstrapServers() { BootstrapServers instance = await BootstrapServers.Instance(); await instance.Install(); }