Package io.netty.channel

Examples of io.netty.channel.DefaultChannelPromise


        return promise;
    }

    @Override
    public ChannelFuture disconnect() {
        DefaultChannelPromise promise = new DefaultChannelPromise(channel);
        promise.setSuccess();
        return promise;
    }
View Full Code Here


        return promise;
    }

    @Override
    public ChannelFuture close() {
        DefaultChannelPromise promise = new DefaultChannelPromise(channel);
        promise.setSuccess();
        return promise;
    }
View Full Code Here

        return promise;
    }

    @Override
    public ChannelFuture deregister() {
        DefaultChannelPromise promise = new DefaultChannelPromise(channel);
        promise.setSuccess();
        return promise;
    }
View Full Code Here

        return this;
    }

    @Override
    public ChannelFuture write(Object msg) {
        DefaultChannelPromise promise = new DefaultChannelPromise(channel);
        promise.setSuccess();
        return promise;
    }
View Full Code Here

        return promise;
    }

    @Override
    public ChannelFuture writeAndFlush(Object msg) {
        DefaultChannelPromise promise = new DefaultChannelPromise(channel);
        try {
            if (null != handler) {
                handler.write(this, msg, promise);
                handler.flush(this);
            }
        } catch (Exception e) {
            promise.tryFailure(e);
        }
        return promise;
    }
View Full Code Here

        return bufAllocator;
    }

    @Override
    public ChannelPromise newPromise() {
        return new DefaultChannelPromise(channel);
    }
View Full Code Here

        return new DefaultChannelProgressivePromise(channel);
    }

    @Override
    public ChannelFuture newSucceededFuture() {
        return new DefaultChannelPromise(channel).setSuccess();
    }
View Full Code Here

        return new DefaultChannelPromise(channel).setSuccess();
    }

    @Override
    public ChannelFuture newFailedFuture(Throwable cause) {
        return new DefaultChannelPromise(channel).setFailure(cause);
    }
View Full Code Here

        return new DefaultChannelPromise(channel).setFailure(cause);
    }

    @Override
    public ChannelPromise voidPromise() {
        return new DefaultChannelPromise(channel);
    }
View Full Code Here

        Responder responder = new DirectResponder(ctx, message);
        final DispatchHandler myHandler = associatedHandler(message);
        if (myHandler != null) {
            boolean isUdp = ctx.channel() instanceof DatagramChannel;
            LOG.debug("about to respond to {}", message);
            PeerConnection peerConnection = new PeerConnection(message.sender(), new DefaultChannelPromise(ctx.channel()).setSuccess(), heartBeatMillis);
            myHandler.forwardMessage(message, isUdp ? null : peerConnection, responder);
        } else {
          //do better error handling, if a handler is not present at all, print a warning
          if(ioHandlers.isEmpty()) {
            LOG.debug("No handler found for {}. Probably we have shutdown this peer.", message);
View Full Code Here

TOP

Related Classes of io.netty.channel.DefaultChannelPromise

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.