개정판 06f13e11
한글 파일명 다운로드 에러 수정
멀티 서비스 수정
Change-Id: I1a7eb48f1c758d32c805eb0394c66b92f9d27330
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/AliveViewModel.cs | ||
---|---|---|
1 |
using Markus.Service.StationController.StationService;
|
|
1 |
using Markus.Service.WcfClient.StationServiceTask;
|
|
2 | 2 |
using System; |
3 | 3 |
using System.Collections.Generic; |
4 | 4 |
using System.ComponentModel; |
... | ... | |
14 | 14 |
{ |
15 | 15 |
BackgroundWorker backgroundWorker; |
16 | 16 |
|
17 |
private List<StationService.ConvertItem> aliveItems;
|
|
17 |
private List<ConvertItem> aliveItems; |
|
18 | 18 |
private bool isLoading; |
19 | 19 |
|
20 | 20 |
public List<ConvertItem> AliveItems |
... | ... | |
67 | 67 |
|
68 | 68 |
foreach (var client in App.StationClientList) |
69 | 69 |
{ |
70 |
var items = await client.AliveConvertListAsync(); |
|
71 |
|
|
72 |
newitems.AddRange(items); |
|
70 |
if (SimplePing(client.Endpoint.Address.ToString())) |
|
71 |
{ |
|
72 |
var items = await client.AliveConvertListAsync(); |
|
73 |
newitems.AddRange(items); |
|
74 |
} |
|
73 | 75 |
} |
74 | 76 |
|
75 | 77 |
newitems.Update(AliveItems); |
... | ... | |
84 | 86 |
|
85 | 87 |
} |
86 | 88 |
|
89 |
|
|
90 |
public static bool SimplePing(string uri) |
|
91 |
{ |
|
92 |
bool result = false; |
|
93 |
|
|
94 |
try |
|
95 |
{ |
|
96 |
using (System.Net.Http.HttpClient Client = new System.Net.Http.HttpClient()) |
|
97 |
{ |
|
98 |
|
|
99 |
System.Net.Http.HttpResponseMessage responseMessage = Client.GetAsync(uri).Result; |
|
100 |
System.Net.HttpStatusCode StatusCode = responseMessage.StatusCode; |
|
101 |
|
|
102 |
switch (StatusCode) |
|
103 |
{ |
|
104 |
|
|
105 |
case System.Net.HttpStatusCode.Accepted: |
|
106 |
case System.Net.HttpStatusCode.OK: |
|
107 |
result = true; |
|
108 |
break; |
|
109 |
} |
|
110 |
} |
|
111 |
} |
|
112 |
catch (Exception) |
|
113 |
{ |
|
114 |
} |
|
115 |
|
|
116 |
return result; |
|
117 |
} |
|
118 |
|
|
87 | 119 |
public override void Loaded() |
88 | 120 |
{ |
89 | 121 |
base.Loaded(); |
내보내기 Unified diff