本文整理汇总了C#中IoSession.RemoveAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# IoSession.RemoveAttribute方法的具体用法?C# IoSession.RemoveAttribute怎么用?C# IoSession.RemoveAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IoSession
的用法示例。
在下文中一共展示了IoSession.RemoveAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageReceived
public override void MessageReceived(INextFilter nextFilter, IoSession session, object message)
{
List<String> phrases = session.GetAttribute<List<String>>("phrases");
if (null == phrases)
{
phrases = new List<String>();
session.SetAttribute("phrases", phrases);
}
phrases.Add((String)message);
if (phrases.Count == 3)
{
session.RemoveAttribute("phrases");
base.MessageReceived(nextFilter, session, new Haiku(phrases
.ToArray()));
}
}
示例2: ResetStatus
private void ResetStatus(IoSession session)
{
session.Config.ReaderIdleTime = 0;
session.Config.WriterIdleTime = 0;
session.Config.SetIdleTime(_interestedIdleStatus, RequestInterval);
session.RemoveAttribute(WAITING_FOR_RESPONSE);
}
示例3: SessionIdle
/// <inheritdoc/>
public override void SessionIdle(INextFilter nextFilter, IoSession session, IdleStatus status)
{
if (status == _interestedIdleStatus)
{
if (!session.ContainsAttribute(WAITING_FOR_RESPONSE))
{
Object pingMessage = _messageFactory.GetRequest(session);
if (pingMessage != null)
{
nextFilter.FilterWrite(session, new DefaultWriteRequest(pingMessage));
//session.Write(pingMessage);
// If policy is OFF, there's no need to wait for
// the response.
if (_requestTimeoutHandler != KeepAliveRequestTimeoutHandler.DeafSpeaker)
{
MarkStatus(session);
if (_interestedIdleStatus == IdleStatus.BothIdle)
{
session.SetAttribute(IGNORE_READER_IDLE_ONCE);
}
}
else
{
ResetStatus(session);
}
}
}
else
{
HandlePingTimeout(session);
}
}
else if (status == IdleStatus.ReaderIdle)
{
if (session.RemoveAttribute(IGNORE_READER_IDLE_ONCE) == null)
{
if (session.ContainsAttribute(WAITING_FOR_RESPONSE))
{
HandlePingTimeout(session);
}
}
}
if (_forwardEvent)
nextFilter.SessionIdle(session, status);
}
示例4: Dispose
public void Dispose(IoSession session)
{
session.RemoveAttribute(CONTEXT);
}
示例5: RemoveSessionBuffer
private void RemoveSessionBuffer(IoSession session)
{
session.RemoveAttribute(BUFFER);
}
示例6: DisposeDecoderOut
private void DisposeDecoderOut(IoSession session)
{
session.RemoveAttribute(DECODER_OUT);
}
示例7: RemoveSessionBuffer
protected void RemoveSessionBuffer(IoSession session)
{
session.RemoveAttribute(BUFFER);
}