Commit Graph

953 Commits

Author SHA1 Message Date
Trustin Lee
7396f9f2b2 Remove Channel.id completely / Use 64-bit hashCode internally to reduce the chance of collision in compareTo() 2013-07-09 14:49:06 +09:00
Norman Maurer
9c1b31d20a [#1535] Remove Channel.id() and so fix the possible leakage of the previous used Channel id map
The user can still use Channel.hashCode() for logging. It's just not 100% unique but should be good enough for most cases
2013-07-08 14:07:18 +02:00
Norman Maurer
39b57b889c [#1539] Fix bug in DefaultChannelGroup.close() which was blocking the close() call on ServerChannel 2013-07-08 13:36:39 +02:00
Trustin Lee
a52ac692a9 Faster MessageList iteration in NioSocketChannel.doWrite() 2013-07-07 15:15:52 +09:00
Trustin Lee
2b2f8db5d2 Use ThreadLocalRandom where possible 2013-07-07 12:37:36 +09:00
Norman Maurer
086ae3536c [#1533] Introduce ByteBufHolder.duplicate() and make use of it in DefaultChannelGroup.write(...) 2013-07-06 21:17:51 +02:00
Trustin Lee
b7e6a86c1e Add MessageList.first() and last() for convenience.
- Fixes #1530
2013-07-05 14:07:51 +09:00
Trustin Lee
0b9235f072 Simplify ByteBufProcessor and MessageListProcessor and Add internal component accessors to CompositeByteBuf
- Fixes #1528

It's not really easy to provide a general-purpose abstraction for fast-yet-safe iteration. Instead of making forEachByte() less optimal, let's make it do what it does really well, and allow a user to implement potentially unsafe-yet-fast loop using unsafe operations.
2013-07-05 14:00:46 +09:00
Norman Maurer
2bda1b530a [#1523] Fix bug which lead to have SelectedKeys handled two times and so caused a NPE on heavy load 2013-07-04 16:15:33 +02:00
Norman Maurer
08b75e594c [#1519] VoidChannelPromise don't fire CancellationException anymore which was incorrect 2013-07-04 09:32:38 +02:00
Norman Maurer
cea873286e [#1517] Only fire the exception throught the pipeline if the channel is registered when using VoidChannelPromise 2013-07-04 09:20:24 +02:00
Trustin Lee
998b408db3 Fix NPE in OioByteStreamChannel
- Do not assign null to 'is' and 'os' but assign an alternative stream implementation
2013-07-04 12:04:28 +09:00
Norman Maurer
7ec12d327f Remove deprecated ByteBufUtil.release(..) and ByteBufUtil.retain(..) methods and its usage. Also fix a problem where an object would have been released two times.
* The problem with the release(..) calls here was that it would have called release on an unsupported message and then throw an exception. This exception will trigger ChannelOutboundBuffer.fail(..), which will also try to release the message again.
* Also use the same exception type for unsupported messages as in other channel impls.
2013-07-03 10:00:13 +02:00
Trustin Lee
956c0f8b90 Better explanation of reentrance issue of ChannelOutboundBuffer 2013-07-02 17:22:56 +09:00
Norman Maurer
5437835832 [#1501] Fix NPE correctly which could accour if ChannelOutboundBuffer.fail(..) triggered another call to ChannelOutboundBuffer.fail(...) 2013-07-02 09:58:41 +02:00
Norman Maurer
8dfbcbda29 [#1501] Fix NPE which could accour if ChannelOutboundBuffer.fail(..) triggered another call to ChannelOutboundBuffer.fail(...) 2013-07-02 09:32:34 +02:00
Trustin Lee
efd9c94775 Use higher maxMessagesPerRead as default for ServerChannels
- Fixes #1493
2013-07-02 10:20:15 +09:00
Trustin Lee
26b56d3add Fix a bug in MessageList.add(T[])
- where it uses incorrect source index while iteration
2013-07-02 10:11:17 +09:00
Trustin Lee
720de2e6cc Add missing sanity check for DefaultChannelHandlerContext.write(...) 2013-07-02 09:36:01 +09:00
Trustin Lee
4b11aff08f Less confusing log messages for system properties
- Fixes #1502
2013-07-02 09:23:29 +09:00
Norman Maurer
5d88c423df [#1500] Remove @deprecated methods 2013-07-01 08:53:02 +02:00
Norman Maurer
617ab6321b [#1489] Correctly handle channelReadSuspended and channelWritabilityChanged in CombinedChannelDuplexHandler 2013-06-30 17:18:33 +02:00
Trustin Lee
ea963c25c9 Improve Javadoc of ChannelPipeline
- Fixes #1226
2013-06-28 22:09:00 +09:00
Trustin Lee
5f1aa6afde Remove potentially misleading exception message
.. because the MessageList itself is not read-only.
2013-06-28 21:25:15 +09:00
Trustin Lee
591dce565a checkExclusive() -> checkIndex() 2013-06-28 21:17:18 +09:00
Trustin Lee
d4665f1703 Fix test failures 2013-06-28 21:14:23 +09:00
Trustin Lee
1e0146da3e Optimize MessageList.add(MessageList, int, int) 2013-06-28 20:53:57 +09:00
Trustin Lee
7cf88a1a3c Add MessageList.array() / Rewrite MessageList.add(T[], int, int)
- MessageList.array() should give better performance + concise code
- MessageList.add(T[], int, int) iterated over the source array 3 times at worst case. This commit reduces that to 1 time.
2013-06-28 20:47:19 +09:00
Trustin Lee
0dcf352f4c Vastly simplified ByteBufProcessor and MessageListProcessor
- Related: #1378
- They now accept only one argument.
- A user who wants to use a buffer for more complex use cases, he or she can always access the buffer directly via memoryAddress() and array()
2013-06-28 20:29:00 +09:00
Trustin Lee
52691488ee Update Javadoc of ByteBufProcessor and MessageListProcessor
- in response to @shacharo's suggestion
2013-06-27 19:01:01 +09:00
Trustin Lee
4dd9b6ef2e Add ByteBufProcessor and ByteBuf.forEach(...)
- Fixes #1378
- Needs to provide optimized forEach implementations though.
2013-06-27 13:55:42 +09:00
Trustin Lee
734ec51ac9 Allow specifying 0 as the default number of threads when instantiating an EventLoopGroup
- Fixes #1426
- We already allow a user instantiate an EventLoopGroup with the default number of threads via the default constructor, so I think it's OK although it's not always optimal.
2013-06-27 10:39:39 +09:00
Trustin Lee
bc483724f4 Improve the documentation of MessageList
- Fixes #1459
2013-06-25 18:27:29 +09:00
Trustin Lee
1f27c3b390 Make NioByteUnsafe.read() respect ChannelConfig.maxMessagesPerRead and adjust the default from 16 to 1
- Fixes #1486
- Decreased the default from 16 to 1 because unnecessary extra read on req-res protocols results in lower throughput due to extra syscalls.
2013-06-25 18:08:39 +09:00
Trustin Lee
a1632e7d15 Add ChannelConfig.maxMessagesPerRead and ChannelOption.MAX_MESSAGES_PER_READ
- Fixes #1486
- Make sure AbstractNioMessageChannel.NioMessageUnsafe.read() only up to maxMessagesPerRead
2013-06-25 17:49:28 +09:00
Trustin Lee
c77f03d886 Fix AdaptiveRecvByteBufAllocator.getSizeTableIndex() 2013-06-25 11:07:15 +09:00
Norman Maurer
c9d01b2fb5 [#1461] Correctly handle DefaultChannelGroup.write(..) of ByteBuf and ByteBufHolder 2013-06-25 11:07:14 +09:00
Trustin Lee
cfb3b977a1 Fix the catastrophic failure caused by AdaptiveRecvByteBufAllocator.getSizeTableIndex() 2013-06-25 11:07:14 +09:00
Trustin Lee
a2f232720b Make AdaptiveRecvByteBufAllocator's lookup table simpler / Optimize buffer size normalization
- No need to have fine-grained lookup table because the buffer pool has
  much more coarse capacities available
- No need to use a loop to normalize a buffer capacity
2013-06-25 11:07:14 +09:00
Trustin Lee
a969613540 Merge ChannelInboundConsumingHandler into SimpleChannelInboundHandler
- SimpleChannelInboundHandler now has a constructor parameter to let a
  user decide to enable automatic message release. (the default is to
  enable), which makes ChannelInboundConsumingHandler of less value.
2013-06-25 11:07:14 +09:00
Norman Maurer
bfc9c6d80d Add ChannelInboundConsumingHandler
..which is useful when the handler is placed at the last position of the
pipeline because it releases the received messages automatically.
2013-06-25 11:07:14 +09:00
Tony Rice
6c5c119f8c Fix incorrect parameter validation in DefaultFileRegion 2013-06-25 11:07:14 +09:00
Norman Maurer
cce74efded [#1448] Don't print failure if VoidChannelPromise is used 2013-06-16 14:25:02 +02:00
Norman Maurer
6a9f965f9b Introduce new utility class calles ReferenceCountUtil and move utility methods from ByteBufUtil to it.
The ones in ByteBufUtil were marked as @deprecated
2013-06-14 07:07:33 +02:00
Norman Maurer
4bf5003f76 Don't release messages before throw UnsupportedOperationException, as the caller method will take care 2013-06-14 06:41:27 +02:00
Trustin Lee
fe40d4b67f Make sure writing to a closed channel does not trigger an UnsupportedOperationException
- Fixes #1442
2013-06-14 11:15:46 +09:00
Trustin Lee
25c51279cf Revert "[#1442] Make sure closing the channel will not cause an UnsupportedOperationException"
This reverts commit a1a86b9de4 because the
semantic of ctx.isRemoved() is confusing to a user - why is
ctx.isRemoved() false when handlerRemoved() is invoked? A better
solution would be check if the connection is inactive and mark the
promise as failure before attempting to write anything.
2013-06-14 10:47:31 +09:00
Trustin Lee
a0c082497a Remove unused exception classes 2013-06-14 10:21:41 +09:00
Norman Maurer
8edee3272a More javadoc fixes 2013-06-13 20:56:17 +02:00
Norman Maurer
dc070a00b2 Deprecate IncompleteFlushException as its not used anymore 2013-06-13 20:50:21 +02:00