示例#1
0
        //
        // Implementation of Reference.GetConnectionCallback
        //

        public void SetConnection(Connection connection, bool compress)
        {
            lock (this)
            {
                Debug.Assert(!_flushing && _exception == null && _connection == null);
                _connection = connection;
                _compress   = compress;
            }

            //
            // If this proxy is for a non-local object, and we are using a router, then
            // add this proxy to the router info object.
            RouterInfo?ri = _reference.RouterInfo;

            if (ri != null && !ri.AddProxy(IObjectPrx.Factory(_reference), this))
            {
                return; // The request handler will be initialized once addProxy returns.
            }

            //
            // We can now send the queued requests.
            //
            FlushRequests();
        }