Examples of discardReadBytes()


Examples of com.alibaba.dubbo.remoting.buffer.ChannelBuffer.discardReadBytes()

                        }
                    }
                } while (frame.readable());
            } finally {
                if (frame.readable()) {
                    frame.discardReadBytes();
                    buffer = frame;
                } else {
                    buffer = ChannelBuffers.EMPTY_BUFFER;
                }
                MinaChannel.removeChannelIfDisconnectd(session);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.buffer.ChannelBuffer.discardReadBytes()

            writtenObjects ++;
            if (writtenObjects % resetInterval == 0) {
                oout.reset();

                // Also discard the byproduct to avoid OOM on the sending side.
                buffer.discardReadBytes();
            }
        }
        oout.writeObject(msg);
        oout.flush();
View Full Code Here

Examples of io.netty.buffer.ByteBuf.discardReadBytes()

                    final Serializable testResult = NettyServer.this.executeTest(archiveId, testClassName, methodName);

                    ObjectOutputStream objectOutstream = null;
                    try {
                        // Write the test result
                        out.discardReadBytes();
                        objectOutstream = new ObjectOutputStream(new ByteBufOutputStream(out));
                        objectOutstream.writeObject(testResult);
                        objectOutstream.flush();
                        ctx.flush();
                        return;
View Full Code Here

Examples of io.netty.buffer.ByteBuf.discardReadBytes()

    @Override
    public void inboundBufferUpdated(final ChannelHandlerContext ctx,
            final ByteBuf in) {
        meter.mark(in.readableBytes());
        final ByteBuf out = ctx.nextOutboundByteBuffer();
        out.discardReadBytes();
        out.writeBytes(in);
        ctx.flush();
    }

    @Override
View Full Code Here

Examples of io.netty.buffer.ByteBuf.discardReadBytes()

    @Override
    public void inboundBufferUpdated(final ChannelHandlerContext ctx,
            final ByteBuf in) {
        final ByteBuf out = ctx.nextOutboundByteBuffer();
        out.discardReadBytes();
        out.writeBytes(in);
        ctx.flush();
    }

    @Override
View Full Code Here

Examples of io.netty.buffer.ByteBuf.discardReadBytes()

        ByteBuf frame = (ByteBuf) super.decode(ctx, in);
        if (frame == null) {
            throw new IOException("Received unexpected empty frame. Maybe you have enabled secure transmission on only one endpoint of the connection.");
        }
        byte type = frame.readByte();
        frame.discardReadBytes();
        String id = frame.toString(CharsetUtil.UTF_8);
        try {
            log.debug("received type {} with id {}", type, id);
            return RecordId.fromString(store.getTracker(), id);
        } catch (IllegalArgumentException e) {
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.discardReadBytes()

                cumulation.writeBytes(input);
            }
        } else {
            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());
                if (input.readable()) {
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.discardReadBytes()

            writtenObjects ++;
            if (writtenObjects % resetInterval == 0) {
                oout.reset();

                // Also discard the byproduct to avoid OOM on the sending side.
                buffer.discardReadBytes();
            }
        }
        oout.writeObject(msg);
        oout.flush();
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.discardReadBytes()

            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        needsCleanup = true;
        cumulation.discardReadBytes();
        cumulation.writeBytes(input);
        callDecode(ctx, e.getChannel(), cumulation, e.getRemoteAddress());
    }

    @Override
View Full Code Here

Examples of net.gleamynode.netty.buffer.ChannelBuffer.discardReadBytes()

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

        ChannelBuffer cumulation = this.cumulation;
        cumulation.discardReadBytes();
        cumulation.writeBytes(input);
        callDecode(ctx, e.getChannel());
    }

    @Override
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.