Commit Graph

1104 Commits

Author SHA1 Message Date
Trustin Lee
4f0a952241 Checkstyle 2013-07-18 21:01:01 +09:00
Trustin Lee
bcef796dc7 Rewrite ChannelOutboundBuffer
- Merge MessageList into ChannelOutboundBuffer
- Make ChannelOutboundBuffer a queue-like data structure so that it is nearly impossible to leak a message
- Make ChannelOutboundBuffer public so that AbstractChannel can expose it to its subclasses.
- TODO: Re-enable gathering write in NioSocketChannel
2013-07-18 20:59:14 +09:00
Trustin Lee
b130ee6a6c [maven-release-plugin] prepare for next development iteration 2013-07-18 11:17:42 +09:00
Trustin Lee
10d395e829 [maven-release-plugin] prepare release netty-4.0.3.Final 2013-07-18 11:17:31 +09:00
Trustin Lee
568166d554 Cleanup 2013-07-18 10:29:34 +09:00
Trustin Lee
473af5c98e Fix checkstyle 2013-07-18 10:25:16 +09:00
Trustin Lee
e28594952b Make the cleanup logic in ChannelOutboundBuffer more robust
- Fixes #1601
2013-07-18 10:23:26 +09:00
Trustin Lee
9c8d980a74 Fix a bug where a ChannelFutureListener can allow Unsafe.close() and Unsafe.flush() to overlap and reenter from flush() to close().
- Fixes #1600
2013-07-18 10:14:55 +09:00
Norman Maurer
fc7c950b08 [maven-release-plugin] prepare for next development iteration 2013-07-17 15:58:36 +02:00
Norman Maurer
bbbf72359e [maven-release-plugin] prepare release netty-4.0.2.Final 2013-07-17 15:58:28 +02:00
Trustin Lee
88cbdb50d2 Fail unflushed writes with ClosedChannelException
... instead of cryptic exception message.
2013-07-17 21:25:51 +09:00
Trustin Lee
5f235eafc3 Fix checkstyle 2013-07-17 21:17:52 +09:00
Trustin Lee
31ecd17212 Fix test failure 2013-07-17 21:16:52 +09:00
Trustin Lee
cc9b9567b9 Make sure all write attempts made after a channel is closed are marked as failure 2013-07-17 21:14:07 +09:00
Trustin Lee
a8d67b0282 Fix data structure corruption and resource leak in ChannelOutboundBuffer 2013-07-17 21:02:56 +09:00
Trustin Lee
dcf7896172 Do not close ServerChannel on IOException while accepting an incoming connection
.. so that we can recover from 'too many open files'

- Fixes #1578
2013-07-16 18:39:29 +09:00
Trustin Lee
57eb531eb8 [maven-release-plugin] prepare for next development iteration 2013-07-16 17:16:10 +09:00
Trustin Lee
76cefcc421 [maven-release-plugin] prepare release netty-4.0.1.Final 2013-07-16 17:15:54 +09:00
Norman Maurer
5297eba280 [maven-release-plugin] prepare for next development iteration 2013-07-15 15:48:15 +02:00
Norman Maurer
c5d8af446a [maven-release-plugin] prepare release netty-4.0.0.Final 2013-07-15 15:48:05 +02:00
Trustin Lee
246a3ecdcb [maven-release-plugin] prepare for next development iteration 2013-07-15 20:58:33 +09:00
Trustin Lee
e8fd209115 [maven-release-plugin] prepare release netty-4.0.0.Final 2013-07-15 20:58:21 +09:00
Norman Maurer
2de491aa7f Use UnpooledByteBufAllocator as default 2013-07-15 10:44:33 +02:00
Norman Maurer
d5f052f39c Rename ChannelGroupMatcher to ChannelMatcher 2013-07-15 10:42:36 +02:00
Norman Maurer
9dfad35423 Fix checkstyle 2013-07-14 18:32:10 +02:00
Norman Maurer
75997545ed Fix checkstyle 2013-07-14 18:13:47 +02:00
Norman Maurer
c20c852602 More javadoc fixes 2013-07-14 18:04:33 +02:00
Norman Maurer
43d22f6d23 Remove unused class which was package private anyway 2013-07-14 17:54:07 +02:00
Norman Maurer
a07abee55f Add and correct javadocs 2013-07-13 19:42:02 +02:00
Norman Maurer
2af7db361b [#1573] Fix NPE which could be triggered one failed promises that trigger a close89 2013-07-12 22:57:03 +02:00
Norman Maurer
2871079c4a [#1557] Make the contract of Channel.Unsafe.flush() more clear
* Remove boolean parameter from Channel.Unsafe.flush() method
* Move NIO related things to AbstractNioChannel.NioUnsafe
2013-07-12 19:45:31 +02:00
Trustin Lee
660729bd56 Kill the cruft 2013-07-12 20:41:29 +09:00
Trustin Lee
456994607b || -> && 2013-07-12 20:32:49 +09:00
Trustin Lee
99716993f6 Add a boolean parameter to Channel.Unsafe.flush() so that SelectionKey state check can be bypassed. 2013-07-12 20:14:50 +09:00
Trustin Lee
e10e9d38c4 Fix embarassing compilation error :-/ 2013-07-12 20:12:18 +09:00
Trustin Lee
85a2ba3752 Remove dead code
- Fixed #1557
2013-07-12 20:10:39 +09:00
Trustin Lee
6d1220b55e Reduce garbage in AbstractUnsafe.flush0() 2013-07-12 20:04:01 +09:00
Trustin Lee
529d904d29 Fix a bug where ChannelOutboundBuffer.addFlush() is called multiple times 2013-07-12 20:01:38 +09:00
Trustin Lee
e2fcb06d9a Remove unnecessary try-catch block in AbstractUnsafe.flush() 2013-07-12 20:00:30 +09:00
Norman Maurer
43f12569aa Cache flush(..) tasks which are used when executing with different EventExecutor to lower GC pressure 2013-07-12 11:57:33 +02:00
Norman Maurer
aa64c13bb8 Cleanup 2013-07-12 11:48:26 +02:00
Norman Maurer
d23c3b3382 Introduce ChannelGroupMatcher which can be used to only apply operations of a ChannelGroup on matching Channels.
This is often useful if you for example use a ChannelGroup to hold all connected Channels and want to broadcast a message too all of them
except one Channel.
2013-07-11 10:58:53 +02:00
Norman Maurer
12ea35fd5f Add missing javadocs 2013-07-11 10:26:10 +02:00
Jeff Pinner
224f05e626 Use correct permission mode for java files 2013-07-10 21:58:12 +02:00
Trustin Lee
b7a7c33fe3 Fix a bug in ChannelOutboundBuffer.addFlush()
It should not advance the tail if no write() was issued so far.
2013-07-11 01:05:26 +09:00
Norman Maurer
b57d9f307f Allow per-write promises and disallow promises on flush()
- write() now accepts a ChannelPromise and returns ChannelFuture as most
  users expected.  It makes the user's life much easier because it is
  now much easier to get notified when a specific message has been
  written.
- flush() does not create a ChannelPromise nor returns ChannelFuture.
  It is now similar to what read() looks like.
2013-07-11 00:49:48 +09:00
Norman Maurer
dd763698dc Adjust ChannelGroup to behave the same like a Channel in terms of write and flush 2013-07-10 08:27:11 +02:00
Trustin Lee
7bedd8f28e Simplify the exception handling of ChannelOutboundHandler.write()
DefaultChannelHandlerContext does not trigger exceptionCaught() immediately when ChannelOutboundHandler.write() raises an exception.  It just records the exception until flush() is triggered.  On invokeFlush(), if there's any exception recorded, DefaultChannelHandlerContext will fail the promise without calling ChannelOutboundHandler.flush().  If more than one exception were raised, only the first exception is used as the cause of the failure and the others will be logged at warn level.
2013-07-10 00:36:47 +09:00
Trustin Lee
26e9d70457 Remove channelReadSuspended / Rename messageReceived(Last) to channelRead(Complete)
- Remove channelReadSuspended because it's actually same with messageReceivedLast
- Rename messageReceived to channelRead
- Rename messageReceivedLast to channelReadComplete

We renamed messageReceivedLast to channelReadComplete because it
reflects what it really is for.  Also, we renamed messageReceived to
channelRead for consistency in method names.
2013-07-09 23:58:51 +09:00
Trustin Lee
cbd8817905 Remove MessageList from public API and change ChannelInbound/OutboundHandler accordingly
I must admit MesageList was pain in the ass.  Instead of forcing a
handler always loop over the list of messages, this commit splits
messageReceived(ctx, list) into two event handlers:

- messageReceived(ctx, msg)
- mmessageReceivedLast(ctx)

When Netty reads one or more messages, messageReceived(ctx, msg) event
is triggered for each message.  Once the current read operation is
finished, messageReceivedLast() is triggered to tell the handler that
the last messageReceived() was the last message in the current batch.

Similarly, for outbound, write(ctx, list) has been split into two:

- write(ctx, msg)
- flush(ctx, promise)

Instead of writing a list of message with a promise, a user is now
supposed to call write(msg) multiple times and then call flush() to
actually flush the buffered messages.

Please note that write() doesn't have a promise with it.  You must call
flush() to get notified on completion. (or you can use writeAndFlush())

Other changes:

- Because MessageList is completely hidden, codec framework uses
  List<Object> instead of MessageList as an output parameter.
2013-07-09 23:51:48 +09:00