개정판 1137be84
issue #1164: 네트워크 어댑터를 얻어와 리턴할때 유효한 어댑터를 리턴하도록 수정. Link 가 Up 인 상태의 어댑터가 다른것이 존재 하면 DNS Get 에서 오류가 나면서 내부이지만 외부로 인지하는 케이스가 발생한것으로 예상되어 수정.
Change-Id: I6f8fd50d1d00e9584115f8c9375387b922758e9e
CommonLib/DNSHelper.cs | ||
---|---|---|
16 | 16 |
|
17 | 17 |
foreach (NetworkInterface networkInterface in networkInterfaces) |
18 | 18 |
{ |
19 |
if (networkInterface.OperationalStatus == OperationalStatus.Up) |
|
19 |
if ((networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet || |
|
20 |
networkInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211) && networkInterface.OperationalStatus == OperationalStatus.Up) |
|
20 | 21 |
{ |
21 | 22 |
IPInterfaceProperties ipProperties = networkInterface.GetIPProperties(); |
22 | 23 |
IPAddressCollection dnsAddresses = ipProperties.DnsAddresses; |
23 | 24 |
|
24 | 25 |
foreach (IPAddress dnsAdress in dnsAddresses) |
25 | 26 |
{ |
26 |
return dnsAdress; |
|
27 |
if (dnsAdress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) |
|
28 |
return dnsAdress; |
|
27 | 29 |
} |
28 | 30 |
} |
29 | 31 |
} |
KCOM/App.xaml.cs | ||
---|---|---|
72 | 72 |
} |
73 | 73 |
} |
74 | 74 |
|
75 |
|
|
75 |
|
|
76 | 76 |
public static RestSharp.RestClient BaseClient { get; set; } |
77 | 77 |
public static IKCOM.KCOM_SystemInfo SystemInfo { get; set; } |
78 |
|
|
78 |
|
|
79 | 79 |
|
80 | 80 |
private static OpenProperties ParamDecoding(string DecodingText, System.Text.Encoding oEncoding = null) |
81 | 81 |
{ |
... | ... | |
95 | 95 |
|
96 | 96 |
public App() |
97 | 97 |
{ |
98 |
|
|
98 |
|
|
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
protected override async void OnStartup(StartupEventArgs e) |
102 | 102 |
{ |
103 |
|
|
103 |
|
|
104 | 104 |
try |
105 | 105 |
{ |
106 |
#region // DNS 체크 |
|
107 |
|
|
108 |
string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", ""); |
|
109 |
|
|
110 |
var hostEntry = CommonLib.DNSHelper.GetHostEntryTask(); |
|
111 | 106 |
|
112 |
if (hostEntry == null) |
|
113 |
{ |
|
114 |
System.Diagnostics.Debug.WriteLine("(hostEntry == null"); |
|
115 |
isExternal = true; |
|
116 |
} |
|
117 |
else if (!hostEntry.HostName.EndsWith(localdomain)) |
|
118 |
{ |
|
119 |
// 외부 사용자 |
|
120 |
isExternal = true; |
|
121 |
} |
|
122 |
#endregion |
|
123 | 107 |
|
124 | 108 |
splashScreen.Show(); |
125 |
|
|
109 |
|
|
126 | 110 |
/// create log database and table |
127 | 111 |
using (IAbstractDatabase database = new AppSQLiteDatabase() { FilePath = Path.Combine(AppDataFolder, "log4net.db") }) |
128 | 112 |
{ |
... | ... | |
136 | 120 |
App.DBLogger = LogManager.GetLogger("DBLogger"); |
137 | 121 |
App.FileLogger = LogManager.GetLogger("EventLogger"); |
138 | 122 |
|
123 |
#region // DNS 체크 |
|
124 |
|
|
125 |
string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", ""); |
|
126 |
|
|
127 |
var hostEntry = CommonLib.DNSHelper.GetHostEntryTask(); |
|
128 |
|
|
129 |
if (hostEntry == null) |
|
130 |
{ |
|
131 |
System.Diagnostics.Debug.WriteLine("(hostEntry == null"); |
|
132 |
App.FileLogger.Fatal("hostEntry == null"); |
|
133 |
isExternal = true; |
|
134 |
} |
|
135 |
else if (!hostEntry.HostName.EndsWith(localdomain)) |
|
136 |
{ |
|
137 |
// 외부 사용자 |
|
138 |
App.FileLogger.Fatal("hostEntry != localdomain :" + hostEntry.HostName); |
|
139 |
isExternal = true; |
|
140 |
} |
|
141 |
#endregion |
|
139 | 142 |
//splash.Show(false, false); |
140 |
|
|
143 |
|
|
141 | 144 |
if (e.Args.Count() > 0) |
142 | 145 |
{ |
143 | 146 |
var result = ParamDecoding(e.Args[0].Replace(@"kcom://", "").Replace(@"/", "")); |
... | ... | |
178 | 181 |
//Mode = 0 , 1 , 2 |
179 | 182 |
}; |
180 | 183 |
ParameterMode = true; |
181 |
}
|
|
184 |
} |
|
182 | 185 |
} |
183 | 186 |
|
184 | 187 |
//App.ViewInfo.CreateFinalPDFPermission = false; |
... | ... | |
196 | 199 |
//Support.SetLicense(); |
197 | 200 |
|
198 | 201 |
string sBaseServiceURL = string.Empty;//CommonLib.Common.GetConfigString("BaseClientAddress", "URL", ""); |
199 |
|
|
202 |
|
|
200 | 203 |
#if DEBUG |
201 | 204 |
//sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal); |
202 | 205 |
System.Diagnostics.Debug.WriteLine("sBaseServiceURL"); |
... | ... | |
220 | 223 |
finally |
221 | 224 |
{ |
222 | 225 |
await SplashScreenAsnyc(); |
223 |
}
|
|
226 |
} |
|
224 | 227 |
} |
225 | 228 |
|
226 | 229 |
private async Task<bool> SplashScreenAsnyc() |
내보내기 Unified diff