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

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

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