Commit Graph

3309 Commits

Author SHA1 Message Date
Trustin Lee
efe7fd9539 Uncomment logging in EchoServer 2012-05-12 08:31:55 +09:00
Trustin Lee
7a5f4721b9 Optimize LoggingHandler using lookup tables 2012-05-12 08:31:13 +09:00
Trustin Lee
c57d7dd098 Add EventLoopFactory and make MultithreadEventLoop use it
- based on the feed back from @normanmaurer
2012-05-11 21:47:07 +09:00
Trustin Lee
97c07708a2 Remove unused class 2012-05-11 21:36:47 +09:00
Trustin Lee
1db0cd60c4 Do not attempt to flush when waiting for OP_WRITE 2012-05-11 21:26:54 +09:00
Trustin Lee
4b673c4ebb Fix infinite loop while handling a client socket / Retrofit EchoClient 2012-05-11 21:19:19 +09:00
Trustin Lee
b4610acda1 Implement connect timeout
- Merged ClientChannelConfig back to ChannelConfig
- AbstractChannel handles connect timeout making use of
  EventLoop.schedule()
2012-05-11 20:44:00 +09:00
Trustin Lee
83026f29a4 Make EventLoop a ScheduledExecutorService
- SingleThreadEventLoop now implements ScheduledExecutorService
  - Scheduled tasks are automatically fetched into taskQueue by
    pollTask() and takeTask()
- Removed MapBackedSet because Java 6 provides it
2012-05-11 20:19:57 +09:00
Trustin Lee
a4678a6030 Close all channels when SelectorEventLoop shuts down
- Also removed a FIXME which was fixed already
2012-05-11 11:01:44 +09:00
Trustin Lee
f6d6d1282c Simplify AbstractChannel.toString() 2012-05-11 10:47:45 +09:00
Trustin Lee
2134848111 Ensure the specified future has the correct channel / Cleanup 2012-05-11 09:00:35 +09:00
Trustin Lee
cb718a07c8 Move ChannelFutureFactory.newVoidFuture() to Channel.Unsafe() / Cleanup 2012-05-11 00:57:42 +09:00
Trustin Lee
d02bc1c0d3 Log outbound buffer
- Use uppercase names for outbound events
2012-05-11 00:46:51 +09:00
Trustin Lee
d5b52077fe Remove hexdump option in LoggingHandler and dump always
- Allow a user override the log message instead
- Prettier hex dump
2012-05-11 00:39:44 +09:00
Trustin Lee
da9ecadfc0 Introduce bypass buffer and use it in LoggingHandler
- Added ChannelBufferHolders.(inbound|outbound)BypassBuffer()
  - The holder returned by these methods returns the next handler's
    buffer.  When a handler's new(Inbound|Outbound)Buffer returns
    a bypass holder, your inboundBufferUpdated() and flush()
    implementation should check if the buffer is a bypass and should not
    modify the content of the buffer.
- Channel(Inbound|Outbound)?HandlerAdapter is now abstract.
  - A user has to specify the exact inbound/outbound buffer type
  - It's because there's no way to determine the best buffer type
- Implemented LoggingHandler using the new API.
  - It doesn't dump received or sent messages yet.
- Fixed a bug where DefaultUnsafe.close() does not trigger deregister()
- Fixed a bug where NioSocketChannel.isActive() does not return false
  when closed
2012-05-10 23:19:59 +09:00
Trustin Lee
532672deae Fix unnecessary application of Math.abs() 2012-05-10 21:56:10 +09:00
norman
d56aa76911 Revert "Set source java version to 1.7 where needed. See #312" as it breaks the build
This reverts commit d62977b061.
2012-05-10 10:06:38 +02:00
norman
d62977b061 Set source java version to 1.7 where needed. See #312 2012-05-10 08:09:31 +02:00
Trustin Lee
b4764f6164 Fix infinity loop and timing issues
- Made sure unnecessary interestOps are not OR'd
- Fixed a bug where DefaultChannelFuture.rethrowIfFailed() returns
  silently if the future is not done yet - there's no ways to tell
  the differences between failure and incompleteness.
2012-05-09 23:42:01 +09:00
Trustin Lee
129a2af86a Initial working version of the echo server example
- Optimized AbstractChannelBuffer.discardReadBytes()
- Split ChannelHandlerInvoker into ChannelInboundInvoker and
  ChannelOutboundInvoker
  - Channel implements ChannelOutboundInvoker
  - ChannelOutboundInvoker.nextOut() is now out()
  - ChannelOutboundHandlerContext.out() is now prevOut()
  - Added the outbound operations without future
    parameter to ChannelOutboundInvoker for user convenience
- All async operations which requires a ChannelFuture as a parameter
  now returns ChannelFuture for user convenience
- Added ChannelFutureFactory.newVoidFuture() to allow a user specify
  a dummy future that is of no use
  - I'm unsure if it is actually a good idea to introduce it. It might
    go away later.
- Made the contract of AbstractChannel.doXXX() much simpler and moved
  all common code up to AbstractChannel.DefaultUnsafe
- Added Channel.isOpen()
- Fixed a bug where MultithreadEventLoop always shut down its child
  event loops on construction
- Maybe more changes I don't remember :-)
2012-05-09 22:09:06 +09:00
norman
27358352ac Make sure all MultiCast configuration settings are possible with NIO. See #313 2012-05-09 07:49:18 +02:00
norman
2cd6386a37 Make sure all MultiCast configuration settings are possible with NIO. See #313 2012-05-09 07:45:40 +02:00
Norman Maurer
4b1721af17 Fix regression in ChunkedWriteHandler. See #310 2012-05-06 21:50:15 +02:00
norman
c24eafed48 MemoryAwareThreadPoolExecutor needs to notify ChannelFuture's of the queued ChannelEventRunnable on shutdownNow(). See #309 2012-05-04 14:36:51 +02:00
norman
21a61ce632 Make sure the ChannelFuture's of the MessageEvent's are notified on channelClosed(..) event and on removal of the handler from the ChannelPipeline. See #308 2012-05-04 13:56:34 +02:00
norman
d509425b90 Make sure we fire the event from the io-thread. See #306 2012-05-04 13:49:22 +02:00
norman
781e628dd8 Let ChannelLocal implement Iterable. See #307 2012-05-04 13:23:32 +02:00
norman
ec28cc8ba1 Refactor ChunkedWriteHandler to remove synchronization which can have bad side effects like deadlocks. See #297 and #301 2012-05-04 10:31:06 +02:00
norman
7016b83629 Add @Override annotations 2012-05-04 10:28:57 +02:00
norman
d3c137923f Notify ChannelFuture's of queued writes if the SslHandler gets remove d from the ChannelPipeline. See #306 2012-05-04 10:27:58 +02:00
norman
bc6948c397 Fail all queued writes if the ChunkedWriteHandler is removed from the ChannelPipeline. See #304 2012-05-04 10:26:25 +02:00
norman
2174ce3628 Fail all pending writes on channelClosed(..). See #305 2012-05-04 10:24:28 +02:00
Norman Maurer
f023120a62 Allow to register ChannelFutureListener's that get notified once the inbound of the SSLEngine is closed. See #137 2012-05-03 17:15:03 +02:00
norman
fb52b8a3b2 Make sure ChunkedInput.close() is not called before the write is complete. See #303 2012-05-03 09:24:36 +02:00
Trustin Lee
607d784e5e Retrofit/overhaul the NIO transport with the new API
- Remove large portion of code thanks to the new API
- SocketChannel implementations are instantiated without factories
- Retrofit the existing code with the new API
2012-05-02 21:05:53 +09:00
Norman Maurer
4e528c10fa Fix small race which can lead to resumeTransfer() to not kick in. See #300 2012-05-02 13:15:28 +03:00
Frédéric Brégier
cc0d7d8be5 typo fix! sorry 2012-05-02 12:35:36 +03:00
Frédéric Brégier
62f5623d2a typo fix ! Sorry 2012-05-02 12:33:40 +03:00
Frédéric Brégier
51415ca3ee Merge pull request #296 from fredericBregier/master
Very small fix on skipControlCharacters
2012-05-02 01:41:54 -07:00
Frédéric Brégier
d475a8cc64 Very small fix (readUnsigned while in optimized version it was signed but should be unsigned) 2012-05-02 11:40:28 +03:00
Trustin Lee
9e6f8b46df Retrofit the NIO transport with the new API / improve the new API
- Remove the classes and properties that are not necessary anymore
- Remove SingleThreadEventLoop.newRegistrationTask() and let
  Channel.Unsafe handle registration by itself
- Channel.Unsafe.localAddress() and remoteAddress()
  - JdkChannel is replaced by Channel.Unsafe.
2012-05-02 15:01:58 +09:00
norman
202df0618c Remove workaround for ipv6 link-localaddresses as it not work on most os / jdk versions. See #267 and #295 2012-05-02 07:39:02 +02:00
Trustin Lee
5dda9d1840 Retrofit the socket channel API with the new API 2012-05-02 14:07:50 +09:00
Frédéric Brégier
3edef63fa8 Merge pull request #294 from fredericBregier/master
For Improvement Issues #290 and #290, plus the defect issue #291
2012-05-01 10:13:42 -07:00
Trustin Lee
e65e496fc0 Clear Channel.eventLoop on deregistration 2012-05-01 23:19:31 +09:00
Trustin Lee
1356a0b61e Replace Channel.Unsafe.setEventLoop() with register()
- Added AbstractChannel.doRegister()
2012-05-01 23:18:29 +09:00
Norman Maurer
b2e77beb46 We need to set the exception on each MessageEvent. See #293 2012-05-01 12:00:36 +02:00
Trustin Lee
a83b9704fa Make sure ChannelFutureListeners are invoked from an event loop thread 2012-05-01 18:31:17 +09:00
Trustin Lee
0682421ce1 Remove unused classes
- ChannelPipelineFactory will be replaced with sometime else when I
  refactory the bootstrap package
- FileRegion is going away.  A user can deregister a channel and perform
  such operations by him/herself.  If this turns out to be too
  difficult, I'll introduce a new 'sendfile' operation to the outbound
  handler.
2012-05-01 18:23:59 +09:00
Trustin Lee
1b5960a1a8 Add ClientChannelConfig and move connectTimeoutMillis there 2012-05-01 18:17:12 +09:00