Motivation:
Improve dev exp using DotNetty nuget packages.
Modifications:
- enabled xml-doc output on projects
Result:
xml-docs are packages along binaries in nuget packages.
Motivation:
TlsHandler
Fix TlsHandler, optimize encryption / decryption wrt Write vs Flush semantics, optimize memory retention for sparse communication, adopt IByteBuffer.GetIoBuffers() in TlsHandler.
Modifications:
- TlsHandler is rewritten to use batch->copy->write approach instead of writing directly to SslStream in order to reduce overhead of framing / writing out everything separately.
- TlsHandler uses IByteBuffer.GetIoBuffers intead of direct array access increasing compatibility for non-array-backed buffers.
- TlsHandler and TlsHandler.MediationStream use Task semantics now when reading through SslStream.
- Extra: upgraded to NBench 2.2, xUnit 2.1.0.
- Extra: better portability for .NET Core support.
Result:
TlsHandler provides better framing and much better (x2+) performance (depends on application control of flushing).
TlsHandler operates properly in edge cases when more than one frame is accepted at once and if decrypted frame size is more than 4 KB.
TlsHandler holds only 256 byte buffer while waiting for more data to arrive off the wire.
Extra: DotNetty is almost .NET Core compatible.
Motivation:
Provides good flexible default while lowering memory consumption on average.
Modifications:
- Synced IRecvByteBufAllocator and relevant parts up to date
- Ported AdaptiveRecvByteBufAllocator
- Extra: properly porting ChannelMetadata
Result:
Process of receiving bytes from network is more configurable and allows for both more conservative and more agressive ingestion.
Motivation:
Increasing feature parity and dev convenience through addition of arbitrary data assignment on Channel and related API on Bootstrap classes.
Modifications
- Introduced IAttributeMap, IAttribute<T>, IConstant and related impl artifacts.
- Moved ChannelOption to common constant codebase
- AbstractChannel now inherits from DefaultChannelMap
- Reflection-less child optoins config in ServerBootstrap
- Extra: minor closure allocation fixes, internal API fixes.
Result:
Attributes can be set on Channels, better code portability in Bootstrap.
Modifications:
Added new handlers:
- IdleStateHandler.cs
- ReadTimeoutHandler
- WriteTimeoutHandler
- ChannelDuplexHandler
Added a new utils class for work with time:
- TimeUtil.cs
Motivation:
Support new versions of .NET, have a core framework that is portable across all .NET platforms.
Modifications:
addressing part of issues reported by portability analyzer
Result:
Easier to introduce .NET Platform compatibility in the future.
Motivation:
Modern language features provide for easier to read, more compact code.
Modifications:
- expression body for single line methods
- Extra: fixes in xml docs
- Extra: code style deviations in recent commits
Result:
Cleaner, more consistent code.
Motivation:
In order to avoid buffer copies and yet perform IO efficiently,
it is essential to support sending multiple byte sequences in one call.
Also there should be no additional constraints on IByteBuffer implementations
in order to be accepted by TcpSocketChannel for sending.
Modifications:
- IoBufferCount, GetIoBuffer(), GetIoBuffers() are ported to IByteBuffer and implementations.
- ChannelOutboundBuffer is extended to leverage *IoBuffer* members in order to prepare buffer batches for sending.
- TcpSocketChannel and its ancestors were extended to support sending (sync and async) a list of array segments.
- Extra: fixes WriterIndex positioning in ByteBufferUtil.EncodeString(..).
- Extra: TLS support and exception reporting in benchmark (commented out).
- Extra: fixes async send path in TcpSocketChannel and AbstractSocketChannel.
Result:
A benchmark of single client channel writing to a single server channel runs 3 times faster at 150K op/sec (vs 53K op/sec before) with no increase in CPU consumption.
CompositeByteBuffer can be used directly in IChannel.WriteAsync.
Motivation:
Improving support for future porting efforts relying on special implementations of IRunnable tasks.
Modifications:
- Added IEventExecutor.Schedule(IRunnable, TimeSpan) overload
- Extra: cleaning out IEventExecutor.Unwrap and related IWrappedEventExecutor.
- Extra: fixing synchronization in DefaultChannelPipeline's Replace and DestroyDown methods.
Result:
Better support for IRunnable implementations in execution model.
Motivation:
initial port was based on now dropped netty 5.0. This is an effort to bring core channel model artifacts to terms with ongoing development in netty 4.1. As a result future sync efforts should be much lower.
Modifications:
- Rewrote DefaultChannelPipeline (port as much as possible)
- Updated AbstractChannelHandlerContext (Skip handling is preserved from netty 5.0)
- Revisited AbstractChannel
- Extra: fixes in benchmark
- Extra: tweaking spin count on STEE
Result:
Core channel model elements are up to speed on recent modifications in netty.
Motivation:
Existing rudimentary buffer pool implementation is not flexible to efficiently support scenarios with high variety in message sizes.
Modifications:
- implemented PooledByteBufferAllocator (port of PooledByteBufAllocator) and related artifacts
- made IByteBuffer implement IEquatable<IByteBuffer>, IComparable<IByteBuffer>, implemented Equals, GetHashCode.
- ported test suite for Byte Buffers and fixed discovered issues.
- added suppression of ExecutionContext flow on async read / write on socket-based channels.
- removed old pooled Byte Buffer allocator implementation.
Result:
Support for buffer pooling for larger byte sequences, more efficient usage of memory dedicated for the pool.
Motivation:
Fix up top priority issues to ensure proper working state with recent changes.
Modifications:
- TlsHandler negotiates TLS 1.0+ on server side (#89)
- STEE properly supports graceful shutdown (#7)
- UnpooledHeapByteBuffer.GetBytes honors received index and length (#88)
- Echo E2E test uses length-prefix based framing (#90)
Result:
Setting up DotNetty does not require workarounds for shutdown and hacks to enable negotiation of higher versions of TLS. Tests are passing even with new SslStream behavior.
Motivation
Since signed assemblies became part of the release they slowed down release cycle due to extended effort necessary to prepare nuget packages with signed assemblies.
Modifications
- introduced "Signed" solution configuration
- optional Test Friends (turned off in Signed)
- re-signing support in build script
Result
New releases can be produced quicker with less effort.
Motivation:
use of breakoutInterval setting on SingleThreadEventExecutor while executor is idling is confusing to users and inefficient due to fixed interval wake ups. We can do better by peeking next scheduled task and use its deadline for wait timeout.
While breakoutInterval is still useful while executor is busy, it can be reduced now to much lower number without impacting idle performance.
Modifications:
- When going to wait due to empty immediate queue, consult with scheduled task queue to figure out timeout value (next task's deadline - now).
- default breakoutInterval changed to 100 ms for higher resolution for scheduled tasks while busy.
Result:
Better precision for scheduled tasks at no performance cost while idling.
Motivation:
Allow for less GC when scheduling if Task-based API is not required. Allow for proper cleanup when canceling scheduled task so that associated resources can be cleaned up early.
Modifications:
- Moved out scheduled task implementations from AbstractScheduledEventExecutor
- Introduced IScheduledTask and aligned IScheduledRunnable
- Implemented removal of scheduled task upon its cancellation
- Extra minor fixes
- IByteBuffer.ToString(Encoding) honoring ArrayOffset
- InternalLoggerFactory creating default logging factory lazily
Result:
Scheduled tasks that normally never fire (e.g. timeout handling) do not cause resources to be held up unnecessarily in memory for longer period of time if not necessary.