Go to file
Trustin Lee dd6b7969b7 Give a handler more control over how its buffers' read bytes are discarded.
This pull request adds two new handler methods: discardInboundReadBytes(ctx) and discardOutboundReadBytes(ctx) to ChannelInboundByteHandler and ChannelOutboundByteHandler respectively. They are called between every inboundBufferUpdated() and flush() respectively. Their default implementation is to call discardSomeReadBytes() on their buffers and a user can override this behavior easily. For example, ReplayingDecoder.discardInboundReadBytes() looks like the following:

    @Override
    public void discardInboundReadBytes(ChannelHandlerContext ctx) throws Exception {
        ByteBuf in = ctx.inboundByteBuffer();
        final int oldReaderIndex = in.readerIndex();
        super.discardInboundReadBytes(ctx);
        final int newReaderIndex = in.readerIndex();
        checkpoint -= oldReaderIndex - newReaderIndex;
    }

If a handler, which has its own buffer index variable, extends ReplayingDecoder or ByteToMessageDecoder, the handler can also override discardInboundReadBytes() and adjust its index variable accordingly.
2013-01-09 13:34:09 +09:00
all Fix the incorrect snapshot version number 2012-12-13 22:49:31 +09:00
buffer Optimize AbstractByteBuf.adjustMarkers() 2013-01-04 23:51:11 +09:00
codec Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
codec-http Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
codec-socks Added test cases for NetUtil methods, if we can`t convertAddress we return null 2012-12-29 18:31:53 +01:00
common Add some of the metrics mentioned in #718 2013-01-04 11:27:49 +01:00
example Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
handler Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
license Add Snappy compression codec 2012-12-18 21:09:31 +01:00
metrics-yammer Simpler and more comprehensive method naming in monitor 2012-12-26 13:48:29 +09:00
microbench Remove ChannelBuf/ByteBuf.Unsafe 2012-12-17 17:41:21 +09:00
tarball [#840] Generate the tarball with top level directory 2012-12-30 21:26:08 +01:00
testsuite Don't spin the CPU so much in tests 2013-01-04 07:05:53 +01:00
transport Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
transport-sctp Give a handler more control over how its buffers' read bytes are discarded. 2013-01-09 13:34:09 +09:00
transport-udt [#844] [#867] Add UDT transport 2013-01-07 21:06:22 +01:00
.fbfilter.xml Update license headers 2012-06-04 13:31:44 -07:00
.fbprefs Updated Find Bugs configuration 2009-03-04 10:33:09 +00:00
.gitignore ignore .idea/ folder 2012-01-16 16:01:00 +08:00
LICENSE.txt Relicensed to Apache License v2 2009-08-28 07:15:49 +00:00
NOTICE.txt Add some of the metrics mentioned in #718 2013-01-04 11:27:49 +01:00
pom.xml [#844] [#867] Add UDT transport 2013-01-07 21:06:22 +01:00
README.md Fix README 2012-09-08 20:20:45 +02:00

The Netty Project

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

Getting Netty

    <dependencies>
      ...
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty</artifactId>
        <version>X.Y.Z.Q</version>
        <scope>compile</scope>
      </dependency>
      ...
    </dependencies>

Developer Information

  • Netty is setup to build using Maven

  • You need JDK 7 to build Netty. Netty will run with JDK 5 (3.x) and JDK 6 (4).

  • master branch contains code for Netty 4.x

  • 3 branch contains code for Netty 3.x