org.libtorrent4j.alerts.DhtDirectResponseAlert 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.BDecodeNode;
import org.libtorrent4j.Entry;
import org.libtorrent4j.UdpEndpoint;
import org.libtorrent4j.swig.dht_direct_response_alert;
import org.libtorrent4j.SessionHandle;
/**
* This is posted exactly once for every call to
* {@link SessionHandle#dhtDirectRequest(UdpEndpoint, Entry, long)}.
*
* If the request failed, {@link #response()} will return a default constructed {@link BDecodeNode}.
*
* @author gubatron
* @author aldenml
*/
public final class DhtDirectResponseAlert extends AbstractAlert {
DhtDirectResponseAlert(dht_direct_response_alert alert) {
super(alert);
}
/**
* @return the user data
*/
public long userdata() {
return alert.getUserdata().get();
}
/**
* @return the endpoint
*/
public UdpEndpoint endpoint() {
return new UdpEndpoint(alert.get_endpoint());
}
/**
* @return the response
*/
public BDecodeNode response() {
return new BDecodeNode(alert.response());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy