Package net.gleamynode.netty.channel

Examples of net.gleamynode.netty.channel.ChannelFuture


        }

        Object frame = unwrap(ctx, channel, buffer.read(packetLength));
        if (frame == null && engine.isInboundDone()) {
            for (;;) {
                ChannelFuture future = closeFutures.poll();
                if (future == null) {
                    break;
                }
                ChannelDownstream.close(ctx, channel, future);
            }
View Full Code Here


    }

    private ChannelFuture wrap(PipeContext<ChannelEvent> context, Channel channel)
            throws SSLException {

        ChannelFuture future = null;
        ByteArray msg;
        ByteBuffer outNetBuf = bufferPool.acquire();
        try {
            loop:
            for (;;) {
View Full Code Here

            }
        }
    }

    private ChannelFuture wrapNonAppData(PipeContext<ChannelEvent> ctx, Channel channel) throws SSLException {
        ChannelFuture future = null;
        ByteBuffer outNetBuf = bufferPool.acquire();

        SSLEngineResult result;
        try {
            for (;;) {
View Full Code Here

            final PipeContext<ChannelEvent> context, final ChannelStateEvent e) throws SSLException {
        unwrap(context, e.getChannel(), ByteArray.EMPTY_BUFFER);
        if (!engine.isInboundDone()) {
            if (sentCloseNotify.compareAndSet(false, true)) {
                engine.closeOutbound();
                ChannelFuture closeNotifyFuture = wrapNonAppData(context, e.getChannel());
                closeNotifyFuture.addListener(new ChannelFutureListener() {
                    public void operationComplete(ChannelFuture closeNotifyFuture) throws Exception {
                        closeFutures.offer(e.getFuture());
                    }
                });
                return;
View Full Code Here

        }

        ChannelStateEvent event = (ChannelStateEvent) element;
        OioServerSocketChannel channel =
            (OioServerSocketChannel) event.getChannel();
        ChannelFuture future = event.getFuture();
        ChannelState state = event.getState();
        Object value = event.getValue();

        switch (state) {
        case OPEN:
View Full Code Here

    private void handleAcceptedSocket(ChannelEvent element) {
        if (element instanceof ChannelStateEvent) {
            ChannelStateEvent event = (ChannelStateEvent) element;
            OioAcceptedSocketChannel channel =
                (OioAcceptedSocketChannel) event.getChannel();
            ChannelFuture future = event.getFuture();
            ChannelState state = event.getState();
            Object value = event.getValue();

            switch (state) {
            case OPEN:
                if (Boolean.FALSE.equals(value)) {
                    OioWorker.close(channel, future);
                }
                break;
            case BOUND:
            case CONNECTED:
                if (value == null) {
                    OioWorker.close(channel, future);
                }
                break;
            case INTEREST_OPS:
                OioWorker.setInterestOps(channel, future, ((Integer) value).intValue());
                break;
            }
        } else if (element instanceof MessageEvent) {
            MessageEvent event = (MessageEvent) element;
            OioSocketChannel channel = (OioSocketChannel) event.getChannel();
            ChannelFuture future = event.getFuture();
            Object message = event.getMessage();
            OioWorker.write(channel, future, message);
        }
    }
View Full Code Here

        }

        ChannelStateEvent event = (ChannelStateEvent) element;
        NioServerSocketChannel channel =
            (NioServerSocketChannel) event.getChannel();
        ChannelFuture future = event.getFuture();
        ChannelState state = event.getState();
        Object value = event.getValue();

        switch (state) {
        case OPEN:
View Full Code Here

    private void handleAcceptedSocket(ChannelEvent element) {
        if (element instanceof ChannelStateEvent) {
            ChannelStateEvent event = (ChannelStateEvent) element;
            NioSocketChannel channel = (NioSocketChannel) event.getChannel();
            ChannelFuture future = event.getFuture();
            ChannelState state = event.getState();
            Object value = event.getValue();

            switch (state) {
            case OPEN:
View Full Code Here

            Pipeline<ChannelEvent> pipeline, ChannelEvent element) throws Exception {
        if (element instanceof ChannelStateEvent) {
            ChannelStateEvent event = (ChannelStateEvent) element;
            NioClientSocketChannel channel =
                (NioClientSocketChannel) event.getChannel();
            ChannelFuture future = event.getFuture();
            ChannelState state = event.getState();
            Object value = event.getValue();

            switch (state) {
            case OPEN:
View Full Code Here

TOP

Related Classes of net.gleamynode.netty.channel.ChannelFuture

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.