Esempio n. 1
0
        internal void SponsorCall(ISponsor sponsor)
        {
            bool flag = false;

            if (this.state == LeaseState.Expired)
            {
                return;
            }
            lock (this.sponsorTable)
            {
                try
                {
                    object local_3 = this.GetSponsorId(sponsor);
                    this.sponsorCallThread = Thread.CurrentThread.GetHashCode();
                    Lease.AsyncRenewal     local_4 = new Lease.AsyncRenewal(sponsor.Renewal);
                    Lease.SponsorStateInfo temp_22 = (Lease.SponsorStateInfo) this.sponsorTable[local_3];
                    int temp_23 = 1;
                    temp_22.sponsorState = (Lease.SponsorState)temp_23;
                    local_4.BeginInvoke((ILease)this, new AsyncCallback(this.SponsorCallback), (object)null);
                    if (temp_22.sponsorState == Lease.SponsorState.Waiting && this.state != LeaseState.Expired)
                    {
                        this.leaseManager.RegisterSponsorCall(this, local_3, this.sponsorshipTimeout);
                    }
                    this.sponsorCallThread = 0;
                }
                catch (Exception exception_0)
                {
                    flag = true;
                    this.sponsorCallThread = 0;
                }
            }
            if (!flag)
            {
                return;
            }
            this.Unregister(sponsor);
            this.ProcessNextSponsor();
        }
Esempio n. 2
0
        internal void SponsorCall(ISponsor sponsor)
        {
            bool flag = false;

            if (this.state == LeaseState.Expired)
            {
                return;
            }
            Hashtable obj = this.sponsorTable;

            lock (obj)
            {
                try
                {
                    object sponsorId = this.GetSponsorId(sponsor);
                    this.sponsorCallThread = Thread.CurrentThread.GetHashCode();
                    Lease.AsyncRenewal     asyncRenewal     = new Lease.AsyncRenewal(sponsor.Renewal);
                    Lease.SponsorStateInfo sponsorStateInfo = (Lease.SponsorStateInfo) this.sponsorTable[sponsorId];
                    sponsorStateInfo.sponsorState = Lease.SponsorState.Waiting;
                    IAsyncResult asyncResult = asyncRenewal.BeginInvoke(this, new AsyncCallback(this.SponsorCallback), null);
                    if (sponsorStateInfo.sponsorState == Lease.SponsorState.Waiting && this.state != LeaseState.Expired)
                    {
                        this.leaseManager.RegisterSponsorCall(this, sponsorId, this.sponsorshipTimeout);
                    }
                    this.sponsorCallThread = 0;
                }
                catch (Exception)
                {
                    flag = true;
                    this.sponsorCallThread = 0;
                }
            }
            if (flag)
            {
                this.Unregister(sponsor);
                this.ProcessNextSponsor();
            }
        }