Commit Graph

1267 Commits

Author SHA1 Message Date
Trustin Lee
b165134044 Better exception message 2014-01-13 23:30:32 +09:00
Trustin Lee
17c0722862 Add missing validation which results in NPE later 2014-01-13 23:29:41 +09:00
Trustin Lee
9c1b9492d5 Fix a bug where DefaultChannelPipelineTest.testFireChannelRegistered() triggers channelRegistered() twice 2014-01-13 23:27:56 +09:00
Trustin Lee
999b51b026 Get the PID properly on Android
- Related: #2109
2014-01-13 22:28:28 +09:00
Trustin Lee
6df3bb5a79 Fix a problem where DefaultChannelId prevents Netty 5 from running on Android
- Fixes #2109
- Use reflection to find the current PID
2014-01-13 17:33:55 +09:00
Norman Maurer
9276fbaea0 [#2104] Make sure we only act on the SelectionKey if it is valid 2014-01-09 18:28:33 +01:00
Trustin Lee
2af1419056 Fix a potential NPE due to the race between a connection attempt and its cancellation
- should fix #2086
2014-01-09 19:25:08 +09:00
Norman Maurer
0b8e732c6c [#2086] Fix race which could produce NPE in AbstractNioUnsafe.finishConnect 2014-01-09 08:22:56 +01:00
milenkovicm
06823e3aff ChannelOutboundBuffer returns total pending write size
total pending write size may be used to optimize write batching
2014-01-07 06:57:20 +01:00
Veebs
194ba39bc0 Fix typo 2014-01-03 11:15:30 +01:00
Michael Nitschinger
299ce22938 Fix typo in EmbeddedSocketAddress. 2014-01-02 15:34:15 +01:00
Trustin Lee
f3a842ecca [maven-release-plugin] prepare for next development iteration 2013-12-22 22:06:15 +09:00
Trustin Lee
888dfba76f [maven-release-plugin] prepare release netty-5.0.0.Alpha1 2013-12-22 22:06:06 +09:00
Trustin Lee
0d437baef0 Increase the default maxMessagesPerRead of AbstractNioByteChannel to 16
- Related: #2079
2013-12-21 20:08:15 +09:00
Trustin Lee
3ca3efac52 Fix a bug where adaptive recvbuf size prediction doesn't work correctly when maxMessagesPerRead is > 1 2013-12-21 19:56:36 +09:00
Trustin Lee
4e05c52c2e More graceful registration failure
- Fixes #2060
- Ensure to return a future/promise implementation that does not fail with 'not registered to an event loop' error for registration operations
- If there is no usable event loop available, GlobalEventExecutor.INSTANCE is used as a fallback.
- Add VoidChannel, which is used when an instantiation of a channel fails.
2013-12-21 18:47:03 +09:00
Norman Maurer
e1c47632e8 [#2079] Stop reading once the NIO byte Channel was complete drained 2013-12-21 10:39:29 +01:00
Trustin Lee
04ec2e1330 Add Recycler.Handle.recycle() so that it's possible to recycle an object without an explicit reference to Recycler 2013-12-19 01:10:52 +09:00
Trustin Lee
3e8a1ed611 Fix a race condition where flush() can be triggered before write()
.. when a handler overrides write() but not flush().
2013-12-17 09:51:41 +09:00
Trustin Lee
94d6e44bba 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
2013-12-16 22:22:47 +09:00
Trustin Lee
4302c016d2 Rename flushAndWrite() to writeAndFlush()
- Related: #2066
2013-12-16 14:58:14 +09:00
Norman Maurer
1a9eb05ba0 [#2065] Fix NPE in AbstractOioByteChannel during write to the socket 2013-12-15 11:44:51 +01:00
Trustin Lee
b8ca01bd9e Disable logging temporarily when running testRegistrationAfterShutdown 2013-12-08 14:17:35 +09:00
Trustin Lee
0d70ba4938 Disable logging temporarily when running testRegistrationAfterShutdown2 2013-12-08 14:12:10 +09:00
Trustin Lee
524726fd99 Fix NoSuchElementException raised by ChannelInitializer
.. again.
2013-12-07 11:03:55 +09:00
Trustin Lee
3d54a323ca Revert "Fix NoSuchElementException raised by ChannelInitializer"
This reverts commit 3c453f5dba.
2013-12-07 10:57:13 +09:00
Norman Maurer
643ce2f8c0 Fix all leaks reported during tests
- One notable leak is from WebSocketFrameAggregator
- All other leaks are from tests
2013-12-07 00:47:30 +09:00
Trustin Lee
3c453f5dba Fix NoSuchElementException raised by ChannelInitializer 2013-12-07 00:39:41 +09:00
Trustin Lee
974d1ebf0a Merge package private interfaces into public ones.
- Related: #1989 and #1991
2013-11-27 18:42:23 +09:00
Trustin Lee
110745b0eb Remove the distinction of inbound handlers and outbound handlers
- Fixes #1808
- Move all methods in ChannelInboundHandler and ChannelOutboundHandler up to ChannelHandler
- Remove ChannelInboundHandler and ChannelOutboundHandler
- Deprecate ChannelInboundHandlerAdapter, ChannelOutboundHandlerAdapter, and ChannelDuplexHandler
- Replace CombinedChannelDuplexHandler with ChannelHandlerAppender
  because it's not possible to combine two handlers into one easily now
- Introduce 'Skip' annotation to pass events through efficiently
- Remove all references to the deprecated types and update Javadoc
2013-11-27 17:31:28 +09:00
Trustin Lee
807d96ed6c Simplify bundle generation / Add io.netty.versions.properties to all JARs
- Fixes #2003 properly
- Instead of using 'bundle' packaging, use 'jar' packaging.  This is
  more robust because some strict build tools fail to retrieve the
  artifacts from a Maven repository unless their packaging is not 'jar'.
- All artifacts now contain META-INF/io.netty.version.properties, which
  provides the detailed information about the build and repository.
- Removed OSGi testsuite temporarily because it gives false errors
  during split package test and examination.
- Add io.netty.util.Version for easy retrieval of version information
2013-11-26 22:00:14 +09:00
Trustin Lee
132af3a485 Introduce ChannelHandlerInvoker, dedeciated for invoking event handler methods, and move most handler invocation code in ChannelHandlerContext to the default ChannelHandlerInvoker implementation
- Fixes #1912
- Add ChannelHandlerInvoker and its default implementation
- Add pipeline manipulation methods that accept ChannelHandlerInvoker
- Rename Channel(Inbound|Outbound)Invoker to
  Channel(Inbound|Outbound)Ops to avoid confusion
- Remove the Javadoc references to the package-private interfaces
2013-11-21 14:14:23 +09:00
Trustin Lee
d0e928db70 Additional fix for potential race condition which occurs when a user cancels a connection attempt
- Fixes #1986
2013-11-18 17:00:23 +09:00
Trustin Lee
38f57adb70 Fix an unexpected IllegalStateException from a selector loop when a user cancels a connection attempt
- Fixes #1986
2013-11-18 16:33:49 +09:00
Trustin Lee
786fdbd6e0 Bring back ChannelGroup.find(id) 2013-11-18 15:59:44 +09:00
Trustin Lee
2235873537 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.
2013-11-18 15:30:12 +09:00
Trustin Lee
daf15fc167 Don't create an EmbeddedSocketAddress every time 2013-11-08 18:01:29 +09:00
Norman Maurer
a86e215718 Fix regression which lead to leak buffers when nothing could be read from the Channel.
This was introduced as part of #1812, but fortunatualy was not part of any release.
2013-11-07 07:13:20 +01:00
Trustin Lee
7fff25c0de Remove AUTO_CLOSE option
- Related #1952
- Since 5.0, we ask users decide to close the channel on write failure.
2013-11-05 17:34:48 +09:00
Trustin Lee
e2de807fb0 Add AUTO_CLOSE option
- Fixes #1952
- If AUTO_CLOSE is turned on, Netty will close the channel immediately and automatically on write failure.  The default is false.
2013-11-05 17:23:58 +09:00
Trustin Lee
26415b8f4c Use StringUtil.simpleClassName(..) instead of Class.getSimpleName() where necessary
- Class.getSimpleName() doesn't render anonymous classes very well
- + some minor cleanup
2013-11-04 19:42:33 +09:00
Trustin Lee
6b0025430e Bump the version to 5.0.0.Alpha1 2013-11-04 19:14:40 +09:00
Norman Maurer
de2c6acecf [#1940] Add javadoc to explain how the FileChannel is closed when using DefaultFileRegion 2013-11-02 15:59:56 +01:00
Trustin Lee
9d611a182f Rename SimpleChannelInboundHandler.channelRead0() to messageReceived()
- Related: #1590
2013-11-02 19:59:21 +09:00
Norman Maurer
542efdc7c7 [#1812] All to have NioMessageUnsafe.read() inlined 2013-10-26 17:43:10 +02:00
Trustin Lee
0dda7df344 Add a shortcut method for collision-free naming 2013-10-25 20:01:31 +09:00
Trustin Lee
dc009b2c2c 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.
2013-10-25 19:21:53 +09:00
Norman Maurer
98541be4b7 [#1947] Handle RejectExecutionException graceful for outbound operations 2013-10-25 07:57:25 +02:00
Norman Maurer
db765e5dd4 [#1812] Allow for inline for most common cases when use NioByteUnsafe.read() 2013-10-23 19:53:54 +02:00
Norman Maurer
da1418e269 [#1920] Fix IndexOutOfBoundsException when using PooledByteBufAllocator with SCTP and NIO Datagram channels 2013-10-16 11:51:50 +02:00