All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.libtorrent4j.alerts.DhtAnnounceAlert Maven / Gradle / Ivy

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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy