org.libtorrent4j.alerts.DhtAnnounceAlert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libtorrent4j Show documentation
Show all versions of libtorrent4j Show documentation
A swig Java interface for libtorrent
The newest version!
package org.libtorrent4j.alerts;
import org.libtorrent4j.Address;
import org.libtorrent4j.Sha1Hash;
import org.libtorrent4j.swig.dht_announce_alert;
/**
* This alert is generated when a DHT node announces to an info-hash on our
* DHT node. It belongs to the ``dht_notification`` category.
*
* @author gubatron
* @author aldenml
*/
public final class DhtAnnounceAlert extends AbstractAlert {
DhtAnnounceAlert(dht_announce_alert alert) {
super(alert);
}
/**
* @return the ip
*/
public Address ip() {
return new Address(alert.get_ip());
}
/**
* @return the port
*/
public int port() {
return alert.getPort();
}
/**
* @return the info-hash
*/
public Sha1Hash infoHash() {
return new Sha1Hash(alert.getInfo_hash());
}
}