use of com.biglybt.core.dht.control.DHTControlListener in project BiglyBT by BiglySoftware.
the class DHTView method init.
private void init(Core core) {
try {
PluginInterface dht_pi = core.getPluginManager().getPluginInterfaceByClass(DHTPlugin.class);
if (dht_pi == null) {
return;
}
DHT[] dhts = ((DHTPlugin) dht_pi.getPlugin()).getDHTs();
for (int i = 0; i < dhts.length; i++) {
if (dhts[i].getTransport().getNetwork() == dht_type) {
dht = dhts[i];
break;
}
}
if (dht == null) {
return;
}
controlListener = new DHTControlListener() {
@Override
public void activityChanged(DHTControlActivity activity, int type) {
activityChanged = true;
}
};
dht.getControl().addListener(controlListener);
} catch (Exception e) {
Debug.printStackTrace(e);
}
}
use of com.biglybt.core.dht.control.DHTControlListener in project BiglyBT by BiglySoftware.
the class DHTView method setDHT.
public void setDHT(DHT _dht) {
if (dht == null) {
dht = _dht;
controlListener = new DHTControlListener() {
@Override
public void activityChanged(DHTControlActivity activity, int type) {
activityChanged = true;
}
};
dht.getControl().addListener(controlListener);
} else if (dht == _dht) {
} else {
Debug.out("Not Supported ");
}
}
Aggregations