当前位置: 首页>>代码示例>>C#>>正文


C# Ice.setRequestHandler__方法代码示例

本文整理汇总了C#中Ice.setRequestHandler__方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.setRequestHandler__方法的具体用法?C# Ice.setRequestHandler__怎么用?C# Ice.setRequestHandler__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ice的用法示例。


在下文中一共展示了Ice.setRequestHandler__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: connect

        public RequestHandler connect(Ice.ObjectPrxHelperBase proxy)
        {
            lock(this)
            {
                try
                {
                    if(!initialized())
                    {
                        _proxies.Add(proxy);
                    }
                }
                catch(Ice.LocalException ex)
                {
                    //
                    // Only throw if the connection didn't get established. If
                    // it died after being established, we allow the caller to
                    // retry the connection establishment by not throwing here.
                    //
                    if(_connection == null)
                    {
                        throw ex;
                    }
                }

                return proxy.setRequestHandler__(_requestHandler);
            }
        }
开发者ID:alexmnazarenko,项目名称:ice,代码行数:27,代码来源:ConnectRequestHandler.cs

示例2: getRequestHandler

        getRequestHandler(RoutableReference rf, Ice.ObjectPrxHelperBase proxy)
        {
            if(rf.getCollocationOptimized())
            {
                Ice.ObjectAdapter adapter = _instance.objectAdapterFactory().findObjectAdapter(proxy);
                if(adapter != null)
                {
                    return proxy.setRequestHandler__(new CollocatedRequestHandler(rf, adapter));
                }
            }

            bool connect = false;
            ConnectRequestHandler handler;
            if(rf.getCacheConnection())
            {
                lock(this)
                {
                    if(!_handlers.TryGetValue(rf, out handler))
                    {
                        handler = new ConnectRequestHandler(rf, proxy);
                        _handlers.Add(rf, handler);
                        connect = true;
                    }
                }
            }
            else
            {
                handler = new ConnectRequestHandler(rf, proxy);
                connect = true;
            }

            if(connect)
            {
                rf.getConnection(handler);
            }
            return proxy.setRequestHandler__(handler.connect(proxy));
        }
开发者ID:joshmoore,项目名称:ice,代码行数:37,代码来源:RequestHandlerFactory.cs

示例3: connect

        public RequestHandler connect(Ice.ObjectPrxHelperBase proxy)
        {
            //
            // Initiate the connection if connect() is called by the proxy that
            // created the handler.
            //
            if(Object.ReferenceEquals(proxy, _proxy) && _connect)
            {
                _connect = false; // Call getConnection only once
                _reference.getConnection(this);
            }

            try
            {
                lock(this)
                {
                    if(!initialized())
                    {
                        _proxies.Add(proxy);
                        return this;
                    }
                }
            }
            catch(Ice.LocalException ex)
            {
                throw ex;
            }

            if(_connectionRequestHandler != null)
            {
                proxy.setRequestHandler__(this, _connectionRequestHandler);
                return _connectionRequestHandler;
            }
            else
            {
                return this;                
            }
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:38,代码来源:ConnectRequestHandler.cs


注:本文中的Ice.setRequestHandler__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。