Commit Graph

640 Commits

Author SHA1 Message Date
Trustin Lee
923dde7a5f Do not auto-start read operation 2013-01-03 16:01:41 +09:00
Trustin Lee
103edc4467 Make ChannelConfig.setAutoRead() triggers Channel.read() if autoRead was previously false
- also rename JDK socket and channel variables so that they are less ambiguous
2013-01-01 16:49:21 +09:00
Norman Maurer
5161ca733c Move utility method to abstract base class and correctly handle expand of buffer also for OIO 2012-12-31 22:09:27 +01:00
Trustin Lee
89a16fe01e Fix a bug in NIO transport where inboundBufferSuspended() is triggered even if the channel is closed.
- No non-static wildcard import
2013-01-01 00:35:44 +09:00
Trustin Lee
93fd73fbbf Fix a bug in AioSocketChannel where inboundBufferSuspended() is triggered even if the channel is closed. 2013-01-01 00:27:30 +09:00
Norman Maurer
8cf9f52919 Add new ChanelFuureListener impl that mimic the old behavior of Netty 3 and so allow to also call fireException for outbound operations 2012-12-31 16:17:08 +01:00
Trustin Lee
1e9652b47a Fix a bug in AioSocketChannel where recursive doBeginRead() is allowed unexpectedly 2013-01-01 00:08:58 +09:00
Norman Maurer
e0a6dc0ac3 Remove ChannelFutureProgressListener 2012-12-31 23:27:37 +09:00
Norman Maurer
4e77bacdf7 [#873] [#868] Split ChannelFuture into ChannelFuture and ChannelPromise 2012-12-31 23:27:16 +09:00
Trustin Lee
0909878581 Read only when requested (read-on-demand)
This pull request introduces a new operation called read() that replaces the existing inbound traffic control method. EventLoop now performs socket reads only when the read() operation has been issued. Once the requested read() operation is actually performed, EventLoop triggers an inboundBufferSuspended event that tells the handlers that the requested read() operation has been performed and the inbound traffic has been suspended again. A handler can decide to continue reading or not.

Unlike other outbound operations, read() does not use ChannelFuture at all to avoid GC cost. If there's a good reason to create a new future per read at the GC cost, I'll change this.

This pull request consequently removes the readable property in ChannelHandlerContext, which means how the traffic control works changed significantly.

This pull request also adds a new configuration property ChannelOption.AUTO_READ whose default value is true. If true, Netty will call ctx.read() for you. If you need a close control over when read() is called, you can set it to false.

Another interesting fact is that non-terminal handlers do not really need to call read() at all. Only the last inbound handler will have to call it, and that's just enough. Actually, you don't even need to call it at the last handler in most cases because of the ChannelOption.AUTO_READ mentioned above.

There's no serious backward compatibility issue. If the compiler complains your handler does not implement the read() method, add the following:

public void read(ChannelHandlerContext ctx) throws Exception {
    ctx.read();
}

Note that this pull request certainly makes bounded inbound buffer support very easy, but itself does not add the bounded inbound buffer support.
2012-12-31 23:26:00 +09:00
Norman Maurer
b49b3d9c56 [#879] Notify correct ChannelFuture for queued FileRegions 2012-12-31 11:35:25 +01:00
Norman Maurer
c80b1bb66e [#872] AbstractNioByteChannel and AbstractNioMessageChannel should be public 2012-12-30 12:48:32 +01:00
Norman Maurer
0fb0037eab Rename IpAddresses to NetUtil 2012-12-29 18:25:32 +01:00
Norman Maurer
5d13c7d27b Merge IPUtil and NetworkConstants into IpAddresses and also make naming of methods consistent 2012-12-29 18:17:33 +01:00
Norman Maurer
e2b240799c [#857] Check if the SelectionKey is valid before access readyOps() 2012-12-29 18:07:02 +01:00
Norman Maurer
88838413c7 Javadocs and cleanup intellij warnings 2012-12-27 23:02:13 +01:00
Norman Maurer
a20aba87ab Remove get prefix from Sctp methods to be more inline with the rest 2012-12-27 22:53:42 +01:00
Norman Maurer
6db7250ed9 Javadocs added for SCTP stuff 2012-12-27 22:46:46 +01:00
Norman Maurer
5a4a52a817 [#857] Correctly handle CancelledKeyException 2012-12-27 22:24:07 +01:00
Norman Maurer
852f546b5b [#846] Tighten up visibility 2012-12-25 18:54:55 +01:00
Norman Maurer
a9fdb682be Add javadocs and some small cleanups 2012-12-23 20:58:49 +01:00
Norman Maurer
71b089cb3b Add javadocs and cleanup 2012-12-23 19:24:20 +01:00
Norman Maurer
ae859c2de9 Fix checkstyle 2012-12-23 19:24:05 +01:00
Norman Maurer
e0d42df77b ServerBootstrap needs to have a localAddress defined 2012-12-23 16:05:43 +01:00
Norman Maurer
6ef1729d06 Fix javadocs for ChannelPipeline 2012-12-23 15:54:30 +01:00
Norman Maurer
7d79587ade Make package private 2012-12-23 15:54:14 +01:00
Norman Maurer
e05b071b41 Javadocs update 2012-12-22 19:27:09 +01:00
Norman Maurer
fc4b205bc4 More javadocs 2012-12-22 15:53:01 +01:00
Trustin Lee
9098d069b0 Make FailedChannelFuture and SucceededChannelFuture final 2012-12-22 15:10:38 +09:00
Norman Maurer
b004066f37 Javadoc fixes and remove some uncessary casts + checks 2012-12-21 17:59:37 +01:00
Norman Maurer
a819d26f5c Remove ChannelHandlerLifeCycleException and just use ChannelPipelineException as replacement 2012-12-21 17:10:36 +01:00
Norman Maurer
ef555d268c Add more javadocs and replace some abstract methods with noops as we often implemented them as noops 2012-12-21 17:06:24 +01:00
Norman Maurer
3e31af68e4 More javadocs cleanup 2012-12-21 11:03:35 +01:00
Norman Maurer
e4ed551490 Move shared methods to the AbstractEmbeddedChannel class and add javadocs 2012-12-21 10:41:27 +01:00
Norman Maurer
42a77eda9b And again javadocs cleanup 2012-12-21 07:35:42 +01:00
Norman Maurer
62bf98af8c More javadoc fixes 2012-12-21 07:13:31 +01:00
Norman Maurer
7a9d9d6a88 Fix checkstyle 2012-12-20 19:11:17 +01:00
Norman Maurer
5d6d849acd Mark final, add javadocs, add checks 2012-12-20 16:13:26 +01:00
Norman Maurer
d2060ee3f1 Add more javadocs 2012-12-20 15:45:49 +01:00
Norman Maurer
43d13064d1 [#837] CombinedChannelHandler must pass sendFile(...) to the wrapped ChannelOutboundHandler 2012-12-20 12:25:13 +01:00
Norman Maurer
94dc09c33d Tighten up visibility as the user should use Channel.new*Future 2012-12-20 10:45:12 +01:00
Norman Maurer
35c01660da Merge branch 'master' of github.com:netty/netty 2012-12-19 09:27:18 +01:00
Norman Maurer
fdeff3855d Move ChannelInputShutdownEvent to socket package as this is where it belongs to. Also added some javadocs 2012-12-19 09:27:01 +01:00
Trustin Lee
0e017db89a Return the new buffer's capacity is same with the requested capacity
- Rename capacity variables to reqCapacity or normCapacity to distinguish if its the request capacity or the normalized capacity
- Do not reallocate on ByteBuf.capacity(int) if reallocation is unnecessary; just update the index range.
- Revert the workaround in DefaultChannelHandlerContext
2012-12-19 16:50:05 +09:00
Norman Maurer
b6e83dff4f Add javadocs and also some parameter checks in DefaultFileRegion 2012-12-19 08:24:32 +01:00
Jestan Nirojan
44142efe55 Fixed OioSctpChannel event loop issue #632 by using 3 different selectors 2012-12-19 06:54:06 +01:00
Trustin Lee
3fc3401c08 Remove bad Javadoc in SCTP classes. 2012-12-19 11:58:54 +09:00
Norman Maurer
f6735f8cc9 Add javadocs to AIO and also fix a few warnings 2012-12-18 15:27:52 +01:00
Norman Maurer
7b0ec599d6 Fix config 2012-12-18 11:38:38 +01:00
Norman Maurer
8d89e48177 Add javadocs in the oio package and also fix some intellij warnings 2012-12-18 11:24:25 +01:00