* [0.7.2] Start threads as background in HashedWheelTimer, LoopExecutor, ThreadDeathWatcher
* + code formatting
* [0.7.3] Target net5 and net6 (#2)
target net5 and net6
Adopted TlsHandler for the case when Handshake completion callback is dispatched asynchronously to thread pool
Introduced SingleThreadedEmbededChannel for TlsHandler and SniHandler tests
* + Update DotNetVersion to "6.0.302" in build.ps1
* 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