本文整理汇总了C#中IChannelHandlerContext.Read方法的典型用法代码示例。如果您正苦于以下问题:C# IChannelHandlerContext.Read方法的具体用法?C# IChannelHandlerContext.Read怎么用?C# IChannelHandlerContext.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IChannelHandlerContext
的用法示例。
在下文中一共展示了IChannelHandlerContext.Read方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public virtual void Read(IChannelHandlerContext context) => context.Read();
示例2: ResumeReadingIfNecessary
void ResumeReadingIfNecessary(IChannelHandlerContext context)
{
if (this.InboundBacklogSize == this.mqttTransportSettings.MaxPendingInboundMessages - 1) // we picked up a packet from full queue - now we have more room so order another read
{
context.Read();
}
}
示例3: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
this.DiscardSomeReadBytes();
if (this.decodeWasNull)
{
this.decodeWasNull = false;
if (!context.Channel.Configuration.AutoRead)
{
context.Read();
}
}
context.FireChannelReadComplete();
}
示例4: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
base.ChannelReadComplete(context);
if (this.InboundBacklogSize < this.mqttTransportSettings.MaxPendingInboundMessages)
{
context.Read();
}
}
示例5: ResumeReadingIfNecessary
void ResumeReadingIfNecessary(IChannelHandlerContext context)
{
if (this.InboundBacklogSize == this.settings.MaxPendingInboundMessages - 1) // we picked up a packet from full queue - now we have more room so order another read
{
if (MqttIotHubAdapterEventSource.Log.IsVerboseEnabled)
{
MqttIotHubAdapterEventSource.Log.Verbose("Resuming reading from channel as queue freed up.", string.Format("deviceId: {0}, channel: {1}", this.deviceId, context.Channel));
}
context.Read();
}
}
示例6: ChannelReadComplete
public override void ChannelReadComplete(IChannelHandlerContext context)
{
base.ChannelReadComplete(context);
int inboundBacklogSize = this.InboundBacklogSize;
if (inboundBacklogSize < this.settings.MaxPendingInboundMessages)
{
context.Read();
}
else
{
if (MqttIotHubAdapterEventSource.Log.IsVerboseEnabled)
{
MqttIotHubAdapterEventSource.Log.Verbose(
"Not reading per full inbound message queue",
string.Format("deviceId: {0}, messages queued: {1}, channel: {2}", this.deviceId, inboundBacklogSize, context.Channel));
}
}
}
示例7: ChannelActive
public override void ChannelActive(IChannelHandlerContext context)
{
this.stateFlags = StateFlags.WaitingForConnect;
TimeSpan? timeout = this.settings.ConnectArrivalTimeout;
if (timeout.HasValue)
{
context.Channel.EventLoop.Schedule(CheckConnectTimeoutCallback, context, timeout.Value);
}
base.ChannelActive(context);
context.Read();
}
示例8: Read
public override void Read(IChannelHandlerContext context)
{
State oldState = this.state;
if ((oldState & State.AuthenticationCompleted) == 0)
{
this.state = oldState | State.ReadRequestedBeforeAuthenticated;
}
context.Read();
}