26 Commits

Author SHA1 Message Date
Johnson Yang 38c7c49a90 fix TLS1.3 connection drops if application data sent before TLS authentication completed 2026-01-08 16:44:09 -08:00
nivalxer 977fd6ac09 Fix the issue of TLS handshake failure in .NET 8 environment.
Signed-off-by: nivalxer <nivalxer@gmail.com>
2023-12-02 03:54:10 +08:00
Andrey Ilnitsky 18fbb0839e Target fix: net5 -> net5.0, net6 -> net6.0 (#592) 2022-08-04 14:53:30 -07:00
Andrey Ilnitsky f754c83069 [0.7.3] Target net5 and net6 (#588)
* [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
2022-08-02 16:37:48 -07:00
Andrey Ilnitsky 1cdaadbfaa - target net472 and netstandard2.0
- microsoft.extensions.logging 5.0.0
- microsoft.extensions.configuration 5.0.0
2021-07-16 18:04:31 -07:00
Max Gortman 6515aa0853 set version to 0.6.0 (#435) 2018-10-10 09:16:51 -07:00
SilverFox 797629ac1b Pickup some commits not related to Mono from #374 (#410)
* 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
2018-08-13 11:38:06 -07:00
Johnny Z f227f95966 HTTP 1.1 codec #52 (#256) 2018-04-11 09:31:39 -07:00
SilverFox b2e8b4ba15 Improve unittest and fix some leak (#366)
- 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.
2018-03-07 07:28:40 -08:00
Johnny Z 6b86b1b883 Re align with Netty buffers. (#287) 2017-09-15 11:32:11 -07:00
Max Gortman 5865d225df Fixes #225
extra: flaky test fixes
2017-05-15 11:22:41 -07:00
Johnny Z c79a974400 Changed unit test projects to NET452 required by xunit 2.2.0 (#229) 2017-04-05 10:16:33 -07:00
Johnny Z 107a1c87b1 Follow up .NET tooling to upgraded packages to latest stable version
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
2017-03-21 15:03:36 -07:00
Alex Valuyskiy 00d656c533 Downgraded to net45 (#197) 2017-02-22 12:23:29 -08:00
Max Gortman 52d1bf34d1 Migrating to new .Net Core RC tooling (#192) 2017-02-09 02:30:48 -08:00
Johnny Z 44885964bd Socket-based UDP channel transport (#79). (#171)
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.
2016-11-23 15:45:02 -08:00
Johnny Z 6d1a58df8e Initial Protobuf 2/3 Codec Implementation ( #118) (#163)
Motivation:
Ported/Re-implemented Protobuf codec support into DotNetty

Modifications:
- Added Protobuf 2/3 Codec project
- Added Protobuf 2/3 Codec unit test project.
- Extra: Ported MessageToByteEncoder to DotNetty.Codec.

Result:
Protobuf 2/3 codec supported by DotNetty.
2016-11-16 14:00:06 -08:00
Max Gortman 4f28a55b48 Move to .NET Core tooling (#170)
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+.
2016-11-07 17:50:24 -08:00
egmkang wang 735435be22 Base64 Encoder/Decoder (+2 squashed commit)
Squashed commit:

[bb7fb5b] test Decode randomly

[86c9d76] test Decode randomly
2016-08-27 12:31:24 +08:00
Max Gortman 8ab8c8bf0c porting removal of invoker, better decoupling (#125)
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.
2016-06-13 12:32:06 -07:00
Max Gortman f31c02e346 Fixes TlsHandler from operation, perf and compat POVs.
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.
2016-06-01 14:09:14 -07:00
Max Gortman 1a80817c71 Enables multi-buffer send in TcpSocketChannel. Remove constraints on IByteBuffer for writing.
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.
2016-05-12 18:42:54 -07:00
Max Gortman 47163fde8d switching to C# 6.0 2016-05-05 01:19:49 -07:00
Aaron Stannard 2f3cef46d7 implemented embedded channel close #3
brought AbstractContextHandler up to code
EmbeddedChannelTest passes
fixed LengthFieldBasedFrameDecoder
finished LengthFieldPrepender
finished SwappedByteBuffer
2015-11-05 09:39:21 -08:00
Aaron Stannard 9cf6903b2a Created FAKE script for DotNetty
added a reference to .\src\SharedAssemblyInfo.cs in all release-able projects
added DotNetty nuspec files for each package
fixed XUnit test script
2015-08-12 22:08:54 -07:00
Aaron Stannard 8d77b8a388 implemented LengthFieldBaseFrameDecoder
Implemented the following classes:
- LengthFieldBaseFrameDecoder
- TooLongFrameException
- CorruptedFrameException

Added the following projects:
- DotNetty.Codecs.Tests
2015-07-17 12:27:40 -07:00