* Add some missing method to LoggingHandler
* Avoid to alloc an huge error message when the test not failed.
* Update the unittest
* Update Microsoft.NET.Test.Sdk from 15.0.0 to 15.7.2, fix that unable to debug an unittest for the second time.
* Disable parallelization for InternalLoggerFactoryTest.TestMockReturned to avoid an rare test failure.
* Remove `dotnet-xunit` since it's never used and will be discontinued, see https://xunit.github.io/releases/2.4-beta2
* Remove space from filename
* Switch back to `DiscardSomeReadBytes` since it's avaliable
* Rework some logic in TlsHandler
* Make sure TlsHandler.MediationStream works well with different style of aync calls(Still not work for Mono, see #374)
* Rework some logic in #366, now always close TlsHandler.MediationStream in TlsHandler.HandleFailure since it's never exported.
* Workaround to fix issue 'Microsoft/vstest#1129'.
* Change the default of TcpServerSocketChannel.Metadata.defaultMaxMessagesPerRead to 1
Motivation:
Implement commonly used string-based operations (originally Netty CharSequence) for byte buffers.
Modifications:
Added read/write/get/set strings methods to byte buffers.
Also reduced unsafe pin/unpins for byte operations.
Result:
String-based operations are supported in DotNetty
- Fix#353, SniHandlerTest timeout in net452 and netcoreapp2.1(preview).
- Fix that test for TlsHandlerTest.NoAutoReadHandshakeProgresses never finish in netcoreapp2.0 and 2.1(preview)
- Fix some leak on TlsHandler and EmbeddedChannel.
- Update xunit from 2.2.0 to 2.3.1. That greatly improve the test speed of DotNetty.Buffers.Tests in net452.
Pending write buffers released before Libuv write callbacks.
Modifications:
According to Libuv documentation, write requests sent with uv_write will be queued. It is safe to reuse the uv_write_t object only after the callback passed to uv_write is fired.
Made Libuv tcp writes release buffers only after the write callback is called. Aslo avoid write buffer pin/unpin operations if the byte buffers to write already pinned.
Result:
Fix#348 and potentially reduced write pin/unpin operations.
Motivation:
Provide a generic API and implementation for channel/connection pooling
Modifications:
Add IChannelPool / IChannelPoolMap API and implementations.
Result:
Reusable / Generic pool implementation that users can use.
* Align API and Test of IdleStateHandler with netty 4.1.15(f9003293...7460d90a)
* Fix EmbeddedChannel.ReleaseAll crashes when queue is null
* Fix ReadTimeoutHandler don't close channel when timeout
* Change IdleStateHandler.ChannelIdle and WriteTimeoutHandler.WriteTimedOut to virtual
Motivation:
Make code to be as close to the original to benefit from co-development
UnpooledTests is needed
Modifications:
- added Copy* and CopiedBuffer functions with params support to Unpooled
- added new constuctors with params support to Unpooled
- added CombineBytes to ByteBufferUtil
- constants in AbstractByteBufferAllocator are now public
Result:
- can now verify that the current Unpooled class works as intended
Motivation:
In network programming the int24/uint24 is required in some cases
Modifications:
- added MediumUtil class to DotNetty.Common that provides ToMediumInt and ToUnsignedMediumInt
- added GetMedium, GetUnsignedMedium, SetMedium, ReadMedium, ReadUnsignedMedium, WriteUnsignedMedium, WriteMedium to IByteBuffer and their implementation in various buffers
- added SwapMedium to ByteBufferUtil
Result:
- int24/uint24 support
Motivation:
It is a common task to manage various timeouts in networking code. Normal high precision timers usually trade performance for precision which is a flexible requirement with timeouts.
Modifications:
- added HashedWheelTimer
- moved RejectedExecutionException to Common.Concurrency
Result:
- users may choose to use HWT in their code to avoid contentions due to frequent timer management.
* First cut commit *unfinished
* Replace SNI handler with TlsHandler with certificate selected based on host name found in clientHello
* first cut tests for SniHandler
* test update
* Test update
* Supress further read when handler is replaced
* made the snitest more effective and IDN in hostname lower case as per netty impl
* More asserts to check whether snihandler gets replaces with tlshaldler in the pipeline
* assert server name is always found in clienthello as per the test setup
* Provided option to select default host name in case of error or client hello does not contail SNI extension, otherwise handshake fails in those cases
* More elaborate tests
* verbosity in test
* Fixed Read continues to get called after handler removed and removed the workaround in SniHandler
* relaced goto statement with flag for breaking outer for loop from within switch
* Update SniHandler.cs
* trigger CI build
* addressed review comments
* Fixed task continuation option
* addresses further review comments
* triggere build again with some more assert in test #221
* suppress read logic is still needed due to async "void"
* changing the map to (string -> Task<ServerTlsSettings)
* one more constructor overload
* extensive tls read/write test is not needed since that's already done in tlshandler test
* more readable target host validation in test to force retrigger confusing CI build
* retrigger
* addressed review comment "this generates 30 random data frames. pls replace with new [] { 1 }"
1. Microsoft.Extensions.Configuration from 1.1.0 to 1.1.1
2. Microsoft.Extensions.Logging from 1.1.0 to 1.1.1
3. Google.Protobuf from 3.1.0 to 3.2.0
4. Microsoft.NET.Test.Sdk from 15.0.0 preview to 15.0.0
5. XUnit to 2.2.0 release
6. Moq from alpha to 4.7.1
7. NBench from 0.3.4 to 1.0.0
Motivation:
If pool grows too fast OOM exception may happen.
Modifications:
- add limit on max memory capacity allocated per heap arena, after which allocations are unpooled.
- extra: log exceptions terminating executor loop
Result:
Users have option to limit size of buffer pool.
Modifications
- algorithm of determining best machine's MAC modified to not throw
- added convenient IReferenceCounted.SafeRelease extension method
- added release for buffers in MQTT codec in case processing fails to ensure release (or proper data flow) of the buffer in all cases
- fixed the way string is decoded in MQTT codec
Motivation:
Ported/Re-implemented DatagramChannel/UDP into DotNetty
Modifications:
- Added DatagramChannel/Config into transport project.
- Added DatagramPacket/DefaultAddressedEnvelop/IAddressedEnvelop into transport project.
- Added DatagramPacketEncoder/DatagramPacketDecoder into Codec project.
- Extra: Ported QuoteOfTheMoment UDP example project.
Result:
DatagramChannel/UDP transport is supported by DotNetty.
Motivation
.NET Core tooling allows building for both .NET Framework and .NET Standard while easing pains of running tests and packaging.
Modifications
- csproj -> xproj + project.json
- support for .NET Standard 1.3
- build script is now based on CAKE
- using dotnet CLI for building, testing, packing
- strong name by default (snk included)
Result
DotNetty works on .NET Core and any other platform supporting .NET Standard 1.3+.
Motivation:
as netty moved on to use JCTools directly, it is worth revisiting standard .NET concurrent collection and open queue type election in executor.
Modifications:
- Removed MpscLinkedQueue as redundant (perf is no better than with ConcurrentQueue)
- Introduced CompatibleConcurrentQueue to bridge ConcurrentQueue and IQueue<T> interface, made it the default.
- Updated STEE execution benchmark
Result:
Cleaner solution, less GC pressure from executor actions, ability to specify specialized task queue type (e.g. MpscArrayQueue on server for efficiency (at a cost of extra-mem consumption).
Motivation:
SocketException and ODE are being thrown when disconnecting gracefully.
Modifications:
- dismiss async read completion if it is done on inactive channel
- do not attempt sync-reading from a socket that is not Connected
- extra: fixing echo sample with better practices
- extra: ReadListener for more natural test scenarios
- extra: tweaked nbench spec to work in-loop
Result:
No excessive errors happen during graceful shutdown
Motivation:
Some important SSL Stream settings are hidden in the TlsHandler class
Modifications:
SSLStream is provided by user now via factory method;
TLS settings extended
Results:
More advanced scenarios, like X509 client authentication, are possible to do now
Motivation:
Catching up on recent netty changes, simplifying data flow through channel pipeline
Modifications:
- Replaced IChannelHandlerInvoker with direct methods on IChannelHandlerContext implementation.
- Ported changes in AbstractChannel, DefaultChannelPipeline, etc. to reduce coupling through casting.
Result:
IChannelHandlerInvoker is removed, perf improved, it is easier to implement IChannel or IChannelPipeline from scratch.
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.
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.