Exemple #1
0
        /**
         * When an Edge closes, we must remove it from out
         * Hashtable.
         * @param edge the Edge that closed
         */
        public void CloseHandler(object edge, EventArgs args)
        {
            CphState cphstate = null;

            lock (_sync) {
                cphstate = (CphState)_edge_to_cphstate[edge];
                if (cphstate != null)
                {
                    _edge_to_cphstate.Remove(edge);
                }
            }
            if (cphstate != null)
            {
                ConnectionTable tab = _node.ConnectionTable;
                tab.Unlock(cphstate.LM.ConTypeString, cphstate);
            }
        }
Exemple #2
0
        /**
         * Unlock any lock which is held by this state
         */
        public void Unlock()
        {
            ConnectionTable tab = _node.ConnectionTable;

            tab.Unlock(_contype, this);
        }
Exemple #3
0
        /**
         * If we hold a lock permanently, we may prevent connections
         * to a given address
         * This is called to release a lock from the ConnectionTable.
         * If the lock is not held, it is still safe to call this method
         * (in which case nothing happens).
         */
        protected void Unlock()
        {
            ConnectionTable tab = LocalNode.ConnectionTable;

            tab.Unlock(_contype, this);
        }