Package com.biglybt.core.util
Class NetUtils
- java.lang.Object
-
- com.biglybt.core.util.NetUtils
-
public class NetUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
check_in_progress
private static int
current_check_millis
private static java.util.List<java.net.NetworkInterface>
current_interfaces
private static boolean
first_check
private static java.util.Map<java.lang.Object,java.lang.Object[]>
host_or_address_map
private static int
INC1_NI_CHECK_MILLIS
private static int
INC2_NI_CHECK_MILLIS
private static long
last_ni_check
private static int
MIN_NI_CHECK_MILLIS
(package private) static AESemaphore
ni_sem
private static java.lang.Object
RESULT_NULL
-
Constructor Summary
Constructors Constructor Description NetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.NetworkInterface
getByInetAddress(java.net.InetAddress addr)
static java.net.NetworkInterface
getByName(java.lang.String name)
private static java.net.NetworkInterface
getBySupport(java.lang.Object name_or_address)
static java.net.InetAddress
getLocalHost()
static java.util.List<java.net.NetworkInterface>
getNetworkInterfaces()
private static java.util.Enumeration<java.net.NetworkInterface>
NetworkInterface_getNetworkInterfaces()
Calls NetworkInterface.getNetworkInterface, tries to recover from SocketException on some Android devices
-
-
-
Field Detail
-
MIN_NI_CHECK_MILLIS
private static final int MIN_NI_CHECK_MILLIS
- See Also:
- Constant Field Values
-
INC1_NI_CHECK_MILLIS
private static final int INC1_NI_CHECK_MILLIS
- See Also:
- Constant Field Values
-
INC2_NI_CHECK_MILLIS
private static final int INC2_NI_CHECK_MILLIS
- See Also:
- Constant Field Values
-
current_check_millis
private static int current_check_millis
-
last_ni_check
private static long last_ni_check
-
current_interfaces
private static volatile java.util.List<java.net.NetworkInterface> current_interfaces
-
first_check
private static boolean first_check
-
check_in_progress
private static boolean check_in_progress
-
ni_sem
static final AESemaphore ni_sem
-
host_or_address_map
private static final java.util.Map<java.lang.Object,java.lang.Object[]> host_or_address_map
-
RESULT_NULL
private static final java.lang.Object RESULT_NULL
-
-
Method Detail
-
getNetworkInterfaces
public static java.util.List<java.net.NetworkInterface> getNetworkInterfaces() throws java.net.SocketException
- Throws:
java.net.SocketException
-
getLocalHost
public static java.net.InetAddress getLocalHost() throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
getByName
public static java.net.NetworkInterface getByName(java.lang.String name) throws java.net.SocketException
- Throws:
java.net.SocketException
-
getByInetAddress
public static java.net.NetworkInterface getByInetAddress(java.net.InetAddress addr) throws java.net.SocketException
- Throws:
java.net.SocketException
-
getBySupport
private static java.net.NetworkInterface getBySupport(java.lang.Object name_or_address) throws java.net.SocketException
- Throws:
java.net.SocketException
-
NetworkInterface_getNetworkInterfaces
private static java.util.Enumeration<java.net.NetworkInterface> NetworkInterface_getNetworkInterfaces() throws java.net.SocketException
Calls NetworkInterface.getNetworkInterface, tries to recover from SocketException on some Android devices- Throws:
java.net.SocketException
-
-