예제 #1
0
 public IdleStatusChecker(Int32 interval, Func <IEnumerable <IoSession> > getSessionsFunc)
 {
     _interval  = interval;
     _idleTimer = new Timer(o =>
     {
         AbstractIoSession.NotifyIdleness(getSessionsFunc(), DateTime.Now);
     });
 }
예제 #2
0
        private static void ResetCounter(Object sender, IoFutureEventArgs e)
        {
            AbstractIoSession session = (AbstractIoSession)e.Future.Session;

            Interlocked.Exchange(ref session._scheduledWriteBytes, 0);
            Interlocked.Exchange(ref session._scheduledWriteMessages, 0);
            session._readBytesThroughput       = 0;
            session._readMessagesThroughput    = 0;
            session._writtenBytesThroughput    = 0;
            session._writtenMessagesThroughput = 0;
        }
예제 #3
0
 /// <summary>
 /// </summary>
 public CloseAwareWriteQueue(AbstractIoSession session, IWriteRequestQueue queue)
 {
     _session = session;
     _queue   = queue;
 }