Examples of readable()


Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all data was read before notifying a closed channel.
                callDecode(ctx, e.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partiallyDecoded = decodeLast(ctx, e.getChannel(), cumulation, state);
                    if (partiallyDecoded != null) {
                        fireMessageReceived(ctx, null, partiallyDecoded);
                    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

            ctx.sendUpstream(e);
            return;
        }

        ChannelBuffer input = (ChannelBuffer) m;
        if (!input.readable()) {
            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        if (cumulation.readable()) {
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

        if (!input.readable()) {
            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        if (cumulation.readable()) {
            cumulation.discardReadBytes();
            cumulation.writeBytes(input);
            callDecode(ctx, e.getChannel(), cumulation, e.getRemoteAddress());
        } else {
            callDecode(ctx, e.getChannel(), input, e.getRemoteAddress());
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

    private void cleanup(ChannelHandlerContext ctx, ChannelStateEvent e)
            throws Exception {
        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all frames are read before notifying a closed channel.
                callDecode(ctx, ctx.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partialFrame = decodeLast(ctx, ctx.getChannel(), cumulation);
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all frames are read before notifying a closed channel.
                callDecode(ctx, ctx.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partialFrame = decodeLast(ctx, ctx.getChannel(), cumulation);
                    if (partialFrame != null) {
                        fireMessageReceived(ctx, null, partialFrame);
                    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

                exception = e;
                closed = true;
            }
        }

        if (buf.readable()) {
            // Update the predictor.
            predictor.previousReceiveBufferSize(buf.readableBytes());

            // Fire the event.
            fireMessageReceived(c, buf, remoteAddress);
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        final ChannelBuffer message = (ChannelBuffer) e.getMessage();

        if (! message.readable()) {
            return;
        }

        if (! routed) {
            if (usesOctetCountFraming(message)) {
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

            ctx.sendUpstream(e);
            return;
        }

        ChannelBuffer input = (ChannelBuffer) m;
        if (!input.readable()) {
            return;
        }

        if (cumulation.readable()) {
            cumulation.discardReadBytes();
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

            cumulation.discardReadBytes();
            cumulation.writeBytes(input);
            callDecode(ctx, e.getChannel(), cumulation, e.getRemoteAddress());
        } else {
            callDecode(ctx, e.getChannel(), input, e.getRemoteAddress());
            if (input.readable()) {
                cumulation.writeBytes(input);
            }
        }
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()

            ctx.sendUpstream(e);
            return;
        }

        ChannelBuffer input = (ChannelBuffer) m;
        if (!input.readable()) {
            return;
        }

        cumulation.discardReadBytes();
        cumulation.writeBytes(input);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.