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

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

There is a newer version: 2.1.0-35
Show newest version
package org.libtorrent4j.alerts;

import org.libtorrent4j.Address;
import org.libtorrent4j.swig.external_ip_alert;

/**
 * Whenever libtorrent learns about the machines external IP, this alert is
 * generated. The external IP address can be acquired from the tracker (if it
 * supports that) or from peers that supports the extension protocol.
 * The address can be accessed through the {@link #externalAddress()} member.
 *
 * @author gubatron
 * @author aldenml
 */
public final class ExternalIpAlert extends AbstractAlert {

    ExternalIpAlert(external_ip_alert alert) {
        super(alert);
    }

    /**
     * The IP address that is believed to be our external IP.
     *
     * @return the external address
     */
    public Address externalAddress() {
        return new Address(alert.get_external_address());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy