Open 491134648 opened 5 years ago
It not an reference counter exception. In fact System.Collections.Generic.Queue<T>
is not thread-safe and can not be used concurrently.
And what's the full stacktrace, looks like an exception in other code. DotNetty only use Queue<T>
in DotNetty.Codecs.Http
,DotNetty.Handlers.Streams.ChunkedWriteHandler<T>
and EmbeddedChannel
It's supposed to be my business code problem, thank you.
My business code is to implement ChannelHandlerAdapter, and then convert msg to Byte[], and when parsing byte byte arrays at high concurrency, there will be reference counter exceptions System.ArgumentOutOfRangeException: Count must be positive and count must refer to a location within the string/array/collection. Parameter name: count at System.Array.IndexOf[T](T[] array, T value, Int32 startIndex, Int32 count) at System.Collections.Generic.Queue`1.Contains(T item)
`public class SocketByteHandler: ChannelHandlerAdapter {
`public void Init(ServerOptions options,Func handler)
{
_options = options;
if (options.EventLoopCount > 0)
{
bossGroup = new MultithreadEventLoopGroup(options.EventLoopCount);
}
else
{
bossGroup = new MultithreadEventLoopGroup();
}
workerGroup = new MultithreadEventLoopGroup();
bootstrap = new ServerBootstrap();
bootstrap.Group(bossGroup, workerGroup);
bootstrap.Channel();