equal
deleted
inserted
replaced
25 import java.io.*; |
25 import java.io.*; |
26 import java.util.*; |
26 import java.util.*; |
27 |
27 |
28 public class Tests { |
28 public class Tests { |
29 |
29 |
30 static boolean isWindows = System.getProperty("os.name").startsWith("Windows"); |
30 static final boolean isWindows = |
|
31 System.getProperty("os.name").startsWith("Windows"); |
|
32 static final boolean isMacOS = |
|
33 System.getProperty("os.name").contains("OS X"); |
31 |
34 |
32 /** |
35 /** |
33 * performs a simple exchange of data between the two sockets |
36 * performs a simple exchange of data between the two sockets |
34 * and throws an exception if there is any problem. |
37 * and throws an exception if there is any problem. |
35 */ |
38 */ |
276 // Skip (Windows)Teredo Tunneling Pseudo-Interface |
279 // Skip (Windows)Teredo Tunneling Pseudo-Interface |
277 if (isWindows) { |
280 if (isWindows) { |
278 String dName = nic.getDisplayName(); |
281 String dName = nic.getDisplayName(); |
279 if (dName != null && dName.contains("Teredo")) |
282 if (dName != null && dName.contains("Teredo")) |
280 continue; |
283 continue; |
|
284 } else if (isMacOS && nic.getName().contains("awdl")) { |
|
285 continue; |
281 } |
286 } |
282 try { |
287 try { |
283 if (nic.isUp() && !nic.isLoopback()) |
288 if (nic.isUp() && !nic.isLoopback()) |
284 return nic; |
289 return nic; |
285 } catch (SocketException e) { |
290 } catch (SocketException e) { |