Package io.netty.buffer

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


                    if (length > remaining) {
                        length -= remaining;
                        buffer.skipBytes(remaining);
                    } else {
                        buffer.skipBytes(length);
                        ctx.writeAndFlush(ACK.retain(1).resetReaderIndex());
                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                        length = 0;
                    }
                }
View Full Code Here


                                case READING:
                                    int remaining = buffer.readableBytes();

                                    if (length > remaining) {
                                        length -= remaining;
                                        buffer.skipBytes(remaining);
                                    } else {
                                        buffer.skipBytes(length);
                                        ctx.writeAndFlush(new DatagramPacket(ACK.retain(1).resetReaderIndex(), message.sender()));
                                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                                        length = 0;
View Full Code Here

                                    if (length > remaining) {
                                        length -= remaining;
                                        buffer.skipBytes(remaining);
                                    } else {
                                        buffer.skipBytes(length);
                                        ctx.writeAndFlush(new DatagramPacket(ACK.retain(1).resetReaderIndex(), message.sender()));
                                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                                        length = 0;
                                    }
                            }
View Full Code Here

                ctx.fireChannelRead(resMetaData);
                return null;/*正常处理后返回*/
            }
        }
        /*                    错误情况*/
        frame.skipBytes(1);
        this.fireProtocolError(ctx, version, frame.readLong());
        return null;
    }
    protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) {
        return buffer.slice(index, length);
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.