Ejemplo n.º 1
0
        void CheckNextSponsor()
        {
            if (_renewingSponsors.Count == 0)
            {
                _currentState     = LeaseState.Expired;
                _renewingSponsors = null;
                return;
            }

            ISponsor nextSponsor = (ISponsor)_renewingSponsors.Peek();

            _renewalDelegate = new RenewalDelegate(nextSponsor.Renewal);
            IAsyncResult ar = _renewalDelegate.BeginInvoke(this, null, null);

            ThreadPool.RegisterWaitForSingleObject(ar.AsyncWaitHandle, new WaitOrTimerCallback(ProcessSponsorResponse), ar, _sponsorshipTimeout, true);
        }
Ejemplo n.º 2
0
		void CheckNextSponsor ()
		{
			if (_renewingSponsors.Count == 0) {
				_currentState = LeaseState.Expired;
				_renewingSponsors = null;
				return;
			}

			ISponsor nextSponsor = (ISponsor) _renewingSponsors.Peek();
			_renewalDelegate = new RenewalDelegate (nextSponsor.Renewal);
			IAsyncResult ar = _renewalDelegate.BeginInvoke (this, null, null);
			ThreadPool.RegisterWaitForSingleObject (ar.AsyncWaitHandle, new WaitOrTimerCallback (ProcessSponsorResponse), ar, _sponsorshipTimeout, true);
		}