Example usage for io.netty.channel AddressedEnvelope retain

List of usage examples for io.netty.channel AddressedEnvelope retain

Introduction

In this page you can find the example usage for io.netty.channel AddressedEnvelope retain.

Prototype

@Override
    AddressedEnvelope<M, A> retain();

Source Link

Usage

From source file:io.vertx.core.dns.impl.fix.DnsQueryContext.java

License:Apache License

private void setSuccess(AddressedEnvelope<? extends DnsResponse, InetSocketAddress> envelope) {
    parent.queryContextManager.remove(nameServerAddr(), id);

    // Cancel the timeout task.
    final ScheduledFuture<?> timeoutFuture = this.timeoutFuture;
    if (timeoutFuture != null) {
        timeoutFuture.cancel(false);/*from  w w  w. j  a v  a 2  s .co  m*/
    }

    Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise = this.promise;
    if (promise.setUncancellable()) {
        @SuppressWarnings("unchecked")
        AddressedEnvelope<DnsResponse, InetSocketAddress> castResponse = (AddressedEnvelope<DnsResponse, InetSocketAddress>) envelope
                .retain();
        promise.setSuccess(castResponse);
    }
}