Esempio n. 1
0
        //
        // Returns router info for a given router. Automatically creates
        // the router info if it doesn't exist yet.
        //
        public RouterInfo get(RouterPrx rtr)
        {
            //
            // The router cannot be routed.
            //
            RouterPrx router = rtr.Clone(clearRouter: true);

            lock (this)
            {
                RouterInfo info;
                if (!_table.TryGetValue(router, out info))
                {
                    info = new RouterInfo(router);
                    _table.Add(router, info);
                }
                return(info);
            }
        }
Esempio n. 2
0
        //
        // Returns router info for a given router. Automatically creates
        // the router info if it doesn't exist yet.
        //
        public RouterInfo erase(RouterPrx rtr)
        {
            RouterInfo info = null;

            if (rtr != null)
            {
                //
                // The router cannot be routed.
                //
                RouterPrx router = rtr.Clone(clearRouter: true);

                lock (this)
                {
                    if (_table.TryGetValue(router, out info))
                    {
                        _table.Remove(router);
                    }
                }
            }
            return(info);
        }