org.libtorrent4j.alerts.ExternalIpAlert 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
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());
}
}