use of com.biglybt.core.instancemanager.ClientInstanceTracked in project BiglyBT by BiglySoftware.
the class NetworkAdminImpl method runInitialChecks.
@Override
public void runInitialChecks(Core core) {
ClientInstanceManager i_man = core.getInstanceManager();
final ClientInstance my_instance = i_man.getMyInstance();
i_man.addListener(new ClientInstanceManagerListener() {
private InetAddress external_address;
@Override
public void instanceFound(ClientInstance instance) {
}
@Override
public void instanceChanged(ClientInstance instance) {
if (instance == my_instance) {
InetAddress address = instance.getExternalAddress();
if (external_address == null || !external_address.equals(address)) {
external_address = address;
try {
lookupCurrentASN(address);
} catch (Throwable e) {
Debug.printStackTrace(e);
}
}
}
}
@Override
public void instanceLost(ClientInstance instance) {
}
@Override
public void instanceTracked(ClientInstanceTracked instance) {
}
});
if (COConfigurationManager.getBooleanParameter("Proxy.Check.On.Start")) {
NetworkAdminSocksProxy[] socks = getSocksProxies();
for (int i = 0; i < socks.length; i++) {
NetworkAdminSocksProxy sock = socks[i];
try {
sock.getVersionsSupported();
} catch (Throwable e) {
Debug.printStackTrace(e);
Logger.log(new LogAlert(true, LogAlert.AT_WARNING, "Socks proxy " + sock.getName() + " check failed: " + Debug.getNestedExceptionMessage(e)));
}
}
NetworkAdminHTTPProxy http_proxy = getHTTPProxy();
if (http_proxy != null) {
try {
http_proxy.getDetails();
} catch (Throwable e) {
Debug.printStackTrace(e);
Logger.log(new LogAlert(true, LogAlert.AT_WARNING, "HTTP proxy " + http_proxy.getName() + " check failed: " + Debug.getNestedExceptionMessage(e)));
}
}
}
if (COConfigurationManager.getBooleanParameter("Check Bind IP On Start")) {
checkBindAddresses(true);
}
NetworkAdminSpeedTestScheduler nast = NetworkAdminSpeedTestSchedulerImpl.getInstance();
nast.initialise();
}
Aggregations