Commit Graph

1313 Commits

Author SHA1 Message Date
Trustin Lee
a0e74ff984 Use thread local direct buffer for I/O when the current allocator is unpooled
- Allocating and deallocating a direct buffer for I/O is an expensive
  operation, so we have to at least have a pool of direct buffers if the
  current allocator is not pooled
2014-02-15 11:24:01 -08:00
Trustin Lee
fbd4385506 Determine the default allocator from system property
- Add ByteBufAllocator.DEFAULT
- The default allocator is now 'pooled'
2014-02-14 13:04:12 -08:00
Trustin Lee
0e4c80b953 Fix IllegalStateException caused by ChannelHandlerAppender 2014-02-13 19:44:40 -08:00
Trustin Lee
c671103289 Deprecate CombinedChannelDuplexHandler in favor of ChannelHandlerAppender
- Fixes #2233
- Add ChannelHandlerAppender
2014-02-13 19:20:56 -08:00
Trustin Lee
7e1db4feb7 Deprecate CombinedChannelDuplexHandler in favor of ChannelHandlerAppender
- Fixes #2233
2014-02-13 19:20:25 -08:00
Trustin Lee
ac70dc4546 Update the version to 4.1.0.Alpha1-SNAPSHOT 2014-02-13 18:32:26 -08:00
Trustin Lee
8837afddf8 Enable a user specify an arbitrary information with ReferenceCounted.touch()
- Related: #2163
- Add ResourceLeakHint to allow a user to provide a meaningful information about the leak when touching it
- DefaultChannelHandlerContext now implements ResourceLeakHint to tell where the message is going.
- Cleaner resource leak report by excluding noisy stack trace elements
2014-02-13 18:16:25 -08:00
Trustin Lee
0235244e55 Touch a ReferenceCounted while it traverses across a pipeline 2014-02-13 18:11:54 -08:00
Trustin Lee
45e70d9935 Add ReferenceCounted.touch() / Add missing retain() overrides
- Fixes #2163
- Inspector warnings
2014-02-13 18:10:11 -08:00
Trustin Lee
7e60877bc5 Merge the attribute map of ChannelHandlerContext into Channel
- Fixes #2136
- Also fixes some generics warnings
2014-02-13 18:02:44 -08:00
Trustin Lee
1d577a8d95 Get the PID properly on Android
- Related: #2109
2014-02-13 17:37:22 -08:00
Trustin Lee
d97f72d2c9 Fix a problem where DefaultChannelId prevents Netty 5 from running on Android
- Fixes #2109
- Use reflection to find the current PID
2014-02-13 17:35:44 -08:00
Trustin Lee
2b84314fdd Add Recycler.Handle.recycle() so that it's possible to recycle an object without an explicit reference to Recycler 2014-02-13 17:24:37 -08:00
Trustin Lee
df346a023b Change the return type of EmbeddedChannel.read*() from Object to an ad-hoc type parameter
.. so that there's no need to explicitly down-cast.

Fixes #2067
2014-02-13 17:19:26 -08:00
Vladimir Krivosheev
eb308cfff6 ability to use Executor instead of ThreadFactory 2014-02-13 16:14:41 -08:00
Trustin Lee
780516471f Bring back ChannelGroup.find(id) 2014-02-13 15:53:45 -08:00
Trustin Lee
40003ed250 Resurrect Channel.id() with global uniqueness
- Fixes #1810
- Add a new interface ChannelId and its default implementation which generates globally unique channel ID.
- Replace AbstractChannel.hashCode with ChannelId.hashCode() and ChannelId.shortValue()
- Add variants of ByteBuf.hexDump() which accept byte[] instead of ByteBuf.
2014-02-13 15:53:07 -08:00
Trustin Lee
812481602a Don't create an EmbeddedSocketAddress every time 2014-02-13 15:45:47 -08:00
Trustin Lee
499033d44f Add a shortcut method for collision-free naming 2014-02-13 15:17:09 -08:00
Trustin Lee
b533a1361b Replace UniqueName with Constant and ConstantPool
- Proposed fix for #1824

UniqueName and its subtypes do not allow getting the previously registered instance.  For example, let's assume that a user is running his/her application in an OSGi container with Netty bundles and his server bundle.  Whenever the server bundle is reloaded, the server will try to create a new AttributeKey instance with the same name.  However, Netty bundles were not reloaded at all, so AttributeKey will complain that the name is taken already (by the previously loaded bundle.)

To fix this problem:

- Replaced UniqueName with Constant, AbstractConstant, and ConstantPool.  Better name and better design.

- Sctp/Udt/RxtxChannelOption is not a ChannelOption anymore.  They are just constant providers and ChannelOption is final now.  It's because caching anything that's from outside of netty-transport will lead to ClassCastException on reload, because ChannelOption's constant pool will keep all option objects for reuse.

- Signal implements Constant because we can't ensure its uniqueness anymore by relying on the exception raised by UniqueName's constructor.
2014-02-13 15:14:34 -08:00
Trustin Lee
2d96b32155 Clean-up ChannelOutboundBufferTest
- partial port of 136e1ebba8
2014-02-13 14:50:11 -08:00
Trustin Lee
a65f097d53 Allow empty handler list when creating a new EmbeddedChannel
.. so that it can be used for dynamically initialized pipelines

- Fixes #1899
2014-02-13 14:46:33 -08:00
Norman Maurer
517da2b46a Fix checkstyle 2014-02-13 14:36:14 -08:00
Bill Gallagher
7e5aa4a911 use enum for state in LocalChannel 2014-02-13 14:35:58 -08:00
Bill Gallagher
a19fe06928 use enum for state in EmbeddedChannel 2014-02-13 14:34:51 -08:00
Trustin Lee
449ce0dd7a Remove the irrelevant AIO channel options 2014-02-13 13:59:12 -08:00
Trustin Lee
faaff9bd86 Backport the tests in ReentrantChannelTest
- Originally from c149f4bcc0 by @wgallagher
2014-02-13 13:55:39 -08:00
Norman Maurer
69a36b8bea Prettify exception message 2014-02-13 06:46:51 +01:00
Norman Maurer
62ebe88981 Allow to set IoRatio to 100% 2014-02-12 15:22:39 +01:00
Norman Maurer
80e6f9adf4 Correctly respect isAutoRead() and make it consistent across OIO/NIO 2014-02-11 20:46:46 +01:00
Norman Maurer
7041a9238e Allow to cancel non-flushed writes 2014-02-11 19:42:49 +01:00
Trustin Lee
d52dc3b740 Do not warn if failed to mark a void promise as success
- it's always supposed to fail.
2014-02-10 15:03:46 -08:00
Trustin Lee
96b0a949e1 Make most outbound operations cancellable / More robust promise update
- Inspired by #2214 by @normanmaurer
- Call setUncancellable() before performing an outbound operation
- Add safeSetSuccess/Failure() and use them wherever
2014-02-10 14:57:18 -08:00
Trustin Lee
041d37e0c8 Make most outbound operations are cancellable
- Inspired by #2214
- It actually reduces the chance of trying to marking a cancelled promise as success again, which raises an IllegalStateException.
2014-02-10 14:06:54 -08:00
Norman Maurer
87602fde25 [#2215] DefaultChannelHandlerContext tasks needs to be volatile to ensure every thread only see full initialized instances 2014-02-08 10:33:44 +01:00
Norman Maurer
9bee78f91c Provide an optimized AtomicIntegerFieldUpdater, AtomicLongFieldUpdater and AtomicReferenceFieldUpdater 2014-02-06 20:08:45 +01:00
Norman Maurer
64c3f58279 Not wakeup the EventLoop for writes as they will not cause a flush anyway 2014-02-01 13:45:27 +01:00
Norman Maurer
f94b563bcd Better exception message to tell the user why it is not supported 2014-01-30 07:02:22 +01:00
Norman Maurer
80ed147652 [#2164] Only reregister SelectionKeys that are still valid 2014-01-29 07:18:29 +01:00
Trustin Lee
9b0e5b9148 Fix API documentation on the usage of AttributeKey 2014-01-28 13:59:11 +09:00
Norman Maurer
f0c7c901d0 Add testcase to try to reproduce #2144 2014-01-23 07:04:42 +01:00
Norman Maurer
d67184b488 [maven-release-plugin] prepare for next development iteration 2014-01-21 08:18:32 +01:00
Norman Maurer
287515210d [maven-release-plugin] prepare release netty-4.0.15.Final 2014-01-21 08:18:26 +01:00
William Kemper
39b8cc348a fix grouping for isActive - socket.isBound is almost always true and should not override 'isOpen' 2014-01-17 07:14:00 +01:00
Trustin Lee
237ba27499 Better exception message 2014-01-13 23:32:49 +09:00
Trustin Lee
3373f83cbb Fix a bug where DefaultChannelPipelineTest.testFireChannelRegistered() triggers channelRegistered() twice 2014-01-13 23:25:32 +09:00
Norman Maurer
13d65d7ccf [#2104] Make sure we only act on the SelectionKey if it is valid 2014-01-09 18:27:56 +01:00
Trustin Lee
751943ed00 Fix a potential NPE due to the race between a connection attempt and its cancellation
- should fix #2086
2014-01-09 19:24:44 +09:00
Norman Maurer
0bbc3facec [#2086] Fix race which could produce NPE in AbstractNioUnsafe.finishConnect 2014-01-09 08:22:34 +01:00
milenkovicm
393f7b2306 ChannelOutboundBuffer returns total pending write size
total pending write size may be used to optimize write batching
2014-01-07 06:52:07 +01:00