本文整理汇总了C#中IChannelHandlerContext.FireChannelInactive方法的典型用法代码示例。如果您正苦于以下问题:C# IChannelHandlerContext.FireChannelInactive方法的具体用法?C# IChannelHandlerContext.FireChannelInactive怎么用?C# IChannelHandlerContext.FireChannelInactive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IChannelHandlerContext
的用法示例。
在下文中一共展示了IChannelHandlerContext.FireChannelInactive方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChannelInactive
public virtual void ChannelInactive(IChannelHandlerContext context) => context.FireChannelInactive();
示例2: 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();
}
}
}
示例3: ChannelInactive
public override void ChannelInactive(IChannelHandlerContext ctx)
{
if (this.Logger.IsEnabled(this.InternalLevel))
{
this.Logger.Log(this.InternalLevel, this.Format(ctx, "INACTIVE"));
}
ctx.FireChannelInactive();
}
示例4: ChannelInactive
public override void ChannelInactive(IChannelHandlerContext context)
{
_cumulativeBuffer.Release();
context.FireChannelInactive();
}
示例5: 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();
}
}
}