//update agent configuration from server public async Task <SrvMonParams> GetServerConfig(SrvMonParams config) { if ((_client == null) || (_client.State != CommunicationState.Opened)) { _client = GetClient(); } try { return(await _client.GetConfigAsync(config, "UserPassword".GetRegString())); } catch (FaultException ex) { (ex.Message).WriteLog(EventLogEntryType.Error, 4); } catch (Exception ex) { (ex.Message + ex.InnerException).WriteLog(EventLogEntryType.Error, 4); _client.Abort(); } return(config); }