本文整理汇总了C#中IChannelHandlerContext.FireChannelReadComplete方法的典型用法代码示例。如果您正苦于以下问题:C# IChannelHandlerContext.FireChannelReadComplete方法的具体用法?C# IChannelHandlerContext.FireChannelReadComplete怎么用?C# IChannelHandlerContext.FireChannelReadComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IChannelHandlerContext
的用法示例。
在下文中一共展示了IChannelHandlerContext.FireChannelReadComplete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChannelReadComplete
public virtual void ChannelReadComplete(IChannelHandlerContext context) => context.FireChannelReadComplete();
示例2: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
this.DiscardSomeReadBytes();
if (this.decodeWasNull)
{
this.decodeWasNull = false;
if (!context.Channel.Configuration.AutoRead)
{
context.Read();
}
}
context.FireChannelReadComplete();
}
示例3: ChannelInactive
public override void ChannelInactive(IChannelHandlerContext ctx)
{
ThreadLocalObjectList output = ThreadLocalObjectList.Take();
try
{
if (this.cumulation != null)
{
this.CallDecode(ctx, this.cumulation, output);
this.DecodeLast(ctx, this.cumulation, output);
}
else
{
this.DecodeLast(ctx, Unpooled.Empty, output);
}
}
catch (DecoderException e)
{
throw e;
}
catch (Exception e)
{
throw new DecoderException(e);
}
finally
{
try
{
if (this.cumulation != null)
{
this.cumulation.Release();
this.cumulation = null;
}
int size = output.Count;
for (int i = 0; i < size; i++)
{
ctx.FireChannelRead(output[i]);
}
if (size > 0)
{
// Something was read, call fireChannelReadComplete()
ctx.FireChannelReadComplete();
}
ctx.FireChannelInactive();
}
finally
{
// recycle in all cases
output.Return();
}
}
}
示例4: HandlerRemoved
public override void HandlerRemoved(IChannelHandlerContext context)
{
IByteBuffer buf = this.InternalBuffer;
int readable = buf.ReadableBytes;
if (readable > 0)
{
IByteBuffer bytes = buf.ReadBytes(readable);
buf.Release();
context.FireChannelRead(bytes);
}
else
{
buf.Release();
}
this.cumulation = null;
context.FireChannelReadComplete();
this.HandlerRemovedInternal(context);
}
示例5: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
this.lastReadTime = TimeUtil.GetSystemTime();
this.reading = false;
context.FireChannelReadComplete();
}
示例6: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
if (this.readerIdleTime.Ticks > 0 || this.allIdleTime.Ticks > 0)
{
this.lastReadTime = TimeUtil.GetSystemTime();
this.reading = false;
}
context.FireChannelReadComplete();
}
示例7: ChannelInputClosed
private void ChannelInputClosed(IChannelHandlerContext context, bool callChannelInactive)
{
var output = RecyclableArrayList.Take();
try
{
if (_cumulation != null)
{
CallDecode(context, _cumulation, output);
DecodeLast(context, _cumulation, output);
}
else
{
DecodeLast(context, Unpooled.Empty, output);
}
}
catch (DecoderException)
{
throw;
}
catch (Exception ex)
{
throw new DecoderException(ex);
}
finally
{
try
{
if (_cumulation != null)
{
_cumulation.Release();
_cumulation = null;
}
var size = output.Count;
FireChannelRead(context, output, size);
if (size > 0)
{
// Something was read, call FireChannelReadComplete()
context.FireChannelReadComplete();
}
if (callChannelInactive)
{
context.FireChannelInactive();
}
}
finally
{
// recycle in all cases
output.Return();
}
}
}
示例8: HandlerRemoved
public override void HandlerRemoved(IChannelHandlerContext context)
{
var buf = InternalBuffer;
var readable = buf.ReadableBytes;
if (readable > 0)
{
var bytes = buf.ReadBytes(readable);
buf.Release();
context.FireChannelRead(bytes);
}
else
{
buf.Release();
}
_cumulation = null;
_numReads = 0;
context.FireChannelReadComplete();
HandlerRemovedInternal(context);
}