Changeset 9461 for branches/HivePerformance/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
- Timestamp:
- 05/07/13 13:54:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r7259 r9461 47 47 } 48 48 49 private int endpointRetries; 50 51 private string workingEndpoint; 52 49 53 private HiveServiceClient NewServiceClient() { 50 HiveServiceClient cl; 54 if (endpointRetries >= Settings.Default.MaxEndpointRetries) { 55 return CreateClient(workingEndpoint); 56 } 57 58 var configurations = Settings.Default.EndpointConfigurationPriorities; 59 60 Exception exception = null; 61 foreach (var endpointConfigurationName in configurations) { 62 try { 63 var cl = CreateClient(endpointConfigurationName); 64 cl.Open(); 65 workingEndpoint = endpointConfigurationName; 66 return cl; 67 } 68 catch (Exception exc) { 69 exception = exc; 70 endpointRetries++; 71 } 72 } 73 74 throw exception; 75 } 76 77 private HiveServiceClient CreateClient(string endpointConfigurationName) { 78 HiveServiceClient cl = null; 79 51 80 if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password)) 52 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( );81 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName); 53 82 else 54 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( null, null, username, password);83 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName, null, username, password); 55 84 56 85 return cl;
Note: See TracChangeset
for help on using the changeset viewer.