13 Commits
Author SHA1 Message Date
Johnny Z 6b86b1b883 Re align with Netty buffers. (#287) 2017-09-15 11:32:11 -07:00
Max Gortman 5ac2fce46d Add ability to limit buffer pool memory capacity (#206)
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.
2017-03-09 19:00:56 -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
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
Max Gortman b2f10c28cb Fixes excessive exceptions from being thrown in case of graceful channel closure. (#152)
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
2016-08-08 15:34:08 -07:00
Max Gortman 6cf5cf5499 Adds attribute support in Channel, Bootstrap [#78]
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.
2016-05-17 17:44:00 -07:00
Max Gortman 8114b7fb21 Fixing minor issues and code style throughout
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.
2016-05-13 12:18:04 -07:00
Aaron Stannard e2dad0e71a added inbound only TcpSocketChannel benchmark 2016-05-13 08:59:25 -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 ab72d4af7b Syncing core channel pipeline elements up to date.
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.
2016-05-09 02:43:03 -07:00
mgortman cef1295c3c PooledByteBufferAllocator port, Byte Buffers improvements
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.
2016-05-05 17:40:07 -07:00
Max Gortman 47163fde8d switching to C# 6.0 2016-05-05 01:19:49 -07:00
Aaron Stannard 31864c6db0 added NBench support + End2End performance spec for TCP 2016-05-01 10:06:10 -07:00