Esempio n. 1
0
 internal NagglingManager(Connection parent, Socket workingSocket, Alachisoft.NCache.Common.DataStructures.Queue msgQueue, long nagglingSize, object syncLock)
 {
     _parent = parent;
     _workingSocket = workingSocket;
     _nagglingSize = nagglingSize;
     _msgQueue = msgQueue;
     _sendBuffer = new byte[_sendBufferSize];
     _syncLock = syncLock;
 }
Esempio n. 2
0
 public UpHandler(Alachisoft.NCache.Common.DataStructures.Queue mq, Protocol handler, string name, int id)
 {
     this.mq = mq;
     this.handler = handler;
     if(name != null)
         Name = name;
     IsBackground = true;
     this.id = id;
 }
Esempio n. 3
0
            public UpHandler(Alachisoft.NCache.Common.DataStructures.Queue mq, Protocol handler)
			{
				this.mq = mq;
				this.handler = handler;
				if (handler != null)
				{
					Name = "UpHandler (" + handler.Name + ')';
				}
				else
				{
					Name = "UpHandler";
				}
				IsBackground = true;
			}
        public DedicatedMessageSender(Alachisoft.NCache.Common.DataStructures.Queue mq, ConnectionTable.Connection connection, object syncLockObj, ILogger NCacheLog, bool onPrimaryNIC, bool doNaggling, int naglingSize)

        {
            this.mq = mq;
            this.peerConnection = connection;
            if (connection != null)
            {
                string primary = connection.IsPrimary ? "p" : "s";
                string primaryNIC = onPrimaryNIC ? "p" : "s";
                Name = "DmSender - " + connection.peer_addr.ToString() + " - " + primary + primaryNIC;

            }

            perfStatsCollector = peerConnection.Enclosing_Instance.enclosingInstance.Stack.perfStatsColl;

            IsBackground = true;
            sync_lock = syncLockObj;
            _ncacheLog = NCacheLog;
            isNagglingEnabled = doNaggling;
            nagglingSize = naglingSize;
            if (nagglingSize + 8 > sendBufferSize) sendBufferSize = nagglingSize + 8;
            sendBuffer = new byte[sendBufferSize];
        }
        public DedicatedMessageSendManager(ILogger NCacheLog)
        {
            mq = new Alachisoft.NCache.Common.DataStructures.Queue();

            _ncacheLog = NCacheLog;
        }
Esempio n. 6
0
		/// <summary>Used internally. If overridden, call this method first. Only creates the down_handler thread
		/// if down_thread is true 
		/// </summary>
		public virtual void  startDownHandler()
		{
			if (down_thread)
			{
				if (down_handler == null)
				{
                    down_queue = new Alachisoft.NCache.Common.DataStructures.Queue();
					down_handler = new DownHandler(down_queue, this);
					down_handler.Start();
				}
			}
		}
Esempio n. 7
0
		/// <summary>Used internally. If overridden, call this method first. Only creates the up_handler thread
		/// if down_thread is true 
		/// </summary>
		public virtual void  startUpHandler()
		{
			if (up_thread)
			{
				if (up_handler == null)
				{
                    up_queue = new Alachisoft.NCache.Common.DataStructures.Queue();
					up_handler = new UpHandler(up_queue, this);
					up_handler.Start();
				}
			}
		}
Esempio n. 8
0
        public override void startUpHandler()
        {
            if (up_thread)
            {

                if (_tokenSeekingUpHandler == null)
                {
                    _tokenMsgUpQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _tokenSeekingUpHandler = new UpHandler(_tokenMsgUpQueue, this, Name + ".token.UpHandler", 3);
                    if (up_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol", "priority " + up_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _tokenSeekingUpHandler.Start();
                }

                if (_sequencedMsgUpHandler == null)
                {
                    _sequenecedMsgUpQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _sequencedMsgUpHandler = new UpHandler(_sequenecedMsgUpQueue, this, Name + ".seq.UpHandler", 2);
                    if (up_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol", "priority " + up_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _sequencedMsgUpHandler.Start();
                }

                if (_sequencelessMsgUpHandler == null)
                {
                    _sequencelessMsgUpQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _sequencelessMsgUpHandler = new UpHandler(_sequencelessMsgUpQueue, this, Name + ".seqless.UpHandler", 1);
                    if (up_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol", "priority " + up_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _sequencelessMsgUpHandler.Start();
                }
            }
        }
Esempio n. 9
0
        public override void startDownHandler()
        {
            if (down_thread)
            {
                if (_unicastDownHandler == null)
                {
                    _unicastDownQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _unicastDownHandler = new DownHandler(_unicastDownQueue, this, Name + ".unicast.DownHandler", 1);
                    if (down_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol.startDownHandler()", "priority " + down_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _unicastDownHandler.Start();
                }
                if (_multicastDownHandler == null)
                {
                    _multicastDownQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _multicastDownHandler = new DownHandler(_multicastDownQueue, this, Name + ".muticast.DownHandler", 2);
                    if (down_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol.startDownHandler()", "priority " + down_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _multicastDownHandler.Start();
                }

                if (_tokenSeekingMsgDownHandler == null)
                {
                    _tokenSeekingMsgDownQueue = new Alachisoft.NCache.Common.DataStructures.Queue();
                    _tokenSeekingMsgDownHandler = new DownHandler(_tokenSeekingMsgDownQueue, this, Name + ".token.DownHandler", 3);
                    if (down_thread_prio >= 0)
                    {
                        try
                        {
                            
                        }
                        catch (System.Exception t)
                        {
                            Stack.NCacheLog.Error("Protocol.startDownHandler()", "priority " + down_thread_prio + " could not be set for thread: " + t.StackTrace);
                        }
                    }
                    _tokenSeekingMsgDownHandler.Start();
                }
            }
        }