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


C# IceInternal.sent方法代码示例

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


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

示例1: flushBatchRequests

        public bool flushBatchRequests(IceInternal.BatchOutgoing @out)
        {
            _m.Lock();
            try
            {
                while(_batchStreamInUse && _exception == null)
                {
                    _m.Wait();
                }

                if(_exception != null)
                {
                    throw _exception;
                }

                if(_batchRequestNum == 0)
                {
                    @out.sent(false);
                    return true;
                }

                //
                // Fill in the number of requests in the batch.
                //
                _batchStream.pos(IceInternal.Protocol.headerSize);
                _batchStream.writeInt(_batchRequestNum);

                @out.attachRemoteObserver(initConnectionInfo(), _endpoint, 
                                          _batchStream.size() - IceInternal.Protocol.headerSize);

                _batchStream.swap(@out.ostr());

                bool sent = false;
                try
                {
                    OutgoingMessage message = new OutgoingMessage(@out, @out.ostr(), _batchRequestCompress, 0);
                    sent = sendMessage(message);
                }
                catch(LocalException ex)
                {
                    setState(StateClosed, ex);
                    Debug.Assert(_exception != null);
                    throw _exception;
                }

                //
                // Reset the batch stream.
                //
                _batchStream = new IceInternal.BasicStream(_instance, Util.currentProtocolEncoding, _batchAutoFlush);
                _batchRequestNum = 0;
                _batchRequestCompress = false;
                _batchMarker = 0;

                return sent;
            }
            finally
            {
                _m.Unlock();
            }
        }
开发者ID:sbesson,项目名称:zeroc-ice,代码行数:60,代码来源:ConnectionI.cs

示例2: flushAsyncBatchRequests

        public bool flushAsyncBatchRequests(IceInternal.OutgoingAsyncBase outAsync, out Ice.AsyncCallback sentCallback)
        {
            lock(this)
            {
                while(_batchStreamInUse && _exception == null)
                {
                    System.Threading.Monitor.Wait(this);
                }

                if(_exception != null)
                {
                    throw _exception;
                }

                if(_batchRequestNum == 0)
                {
                    sentCallback = outAsync.sent();
                    return true;
                }

                //
                // Notify the request that it's cancelable with this connection. 
                // This will throw if the request is canceled.
                //
                outAsync.cancelable(this);

                //
                // Fill in the number of requests in the batch.
                //
                _batchStream.pos(IceInternal.Protocol.headerSize);
                _batchStream.writeInt(_batchRequestNum);

                _batchStream.swap(outAsync.getOs());

                outAsync.attachRemoteObserver(initConnectionInfo(), _endpoint, 0);

                //
                // Send the batch stream.
                //
                bool sent;
                try
                {
                    OutgoingMessage message = new OutgoingMessage(outAsync, outAsync.getOs(), _batchRequestCompress, 0);
                    sent = sendMessage(message);
                    sentCallback = message.sentCallback;
                }
                catch(LocalException ex)
                {
                    setState(StateClosed, ex);
                    Debug.Assert(_exception != null);
                    throw _exception;
                }
                
                //
                // Reset the batch stream.
                //
                _batchStream = new IceInternal.BasicStream(_instance, Util.currentProtocolEncoding);
                _batchRequestNum = 0;
                _batchRequestCompress = false;
                _batchMarker = 0;
                return sent;
            }
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:63,代码来源:ConnectionI.cs


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