• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IceInternal.BasicStream类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IceInternal.BasicStream的典型用法代码示例。如果您正苦于以下问题:C# BasicStream类的具体用法?C# BasicStream怎么用?C# BasicStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BasicStream类属于IceInternal命名空间,在下文中一共展示了BasicStream类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: prepareBatchRequest

        prepareBatchRequest(BasicStream os)
        {
            lock(this)
            {
                while(_batchStreamInUse)
                {
                    Monitor.Wait(this);
                }

                if(_batchStream.isEmpty())
                {
                    try
                    {
                        _batchStream.writeBlob(Protocol.requestBatchHdr);
                    }
                    catch(Ice.LocalException ex)
                    {
                        throw ex;
                    }
                }

                _batchStreamInUse = true;
                _batchMarker = _batchStream.size();
                _batchStream.swap(os);
            }
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:26,代码来源:CollocatedRequestHandler.cs


示例2: WSEndpoint

        internal WSEndpoint(ProtocolInstance instance, EndpointI del, BasicStream s)
        {
            _instance = instance;
            _delegate = (IPEndpointI)del;

            _resource = s.readString();
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:7,代码来源:WSEndpoint.cs


示例3: streamToProxy

 public Ice.ObjectPrx streamToProxy(BasicStream s)
 {
     Ice.Identity ident = new Ice.Identity();
     ident.read__(s);
     
     Reference r = instance_.referenceFactory().create(ident, s);
     return referenceToProxy(r);
 }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:8,代码来源:ProxyFactory.cs


示例4: finishBatchRequest

        public void finishBatchRequest(BasicStream os)
        {
            try
            {
                lock(this)
                {
                    _batchStream.swap(os);

                    if(_batchAutoFlushSize > 0 && (_batchStream.size() > _batchAutoFlushSize))
                    {
                        //
                        // Temporarily save the last request.
                        //
                        byte[] lastRequest = new byte[_batchStream.size() - _batchMarker];
                        Buffer buffer = _batchStream.getBuffer();
                        buffer.b.position(_batchMarker);
                        buffer.b.get(lastRequest);
                        _batchStream.resize(_batchMarker, false);

                        int invokeNum = _batchRequestNum;
                        BasicStream stream = new BasicStream(_reference.getInstance(),
                                                             Ice.Util.currentProtocolEncoding);
                        stream.swap(_batchStream);

                        _adapter.getThreadPool().dispatch(() =>
                        {
                            invokeAll(stream, 0, invokeNum, true);
                        }, null);

                        //
                        // Reset the batch.
                        //
                        _batchRequestNum = 0;
                        _batchMarker = 0;

                        //
                        // Start a new batch with the last message that caused us to go over the limit.
                        //
                        _batchStream.writeBlob(Protocol.requestBatchHdr);
                        _batchStream.writeBlob(lastRequest);
                    }

                    //
                    // Increment the number of requests in the batch.
                    //
                    Debug.Assert(_batchStreamInUse);
                    ++_batchRequestNum;
                    _batchStreamInUse = false;
                    Monitor.PulseAll(this);
                }
            }
            catch(Ice.LocalException ex)
            {
                abortBatchRequest();
                throw ex;
            }
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:57,代码来源:CollocatedRequestHandler.cs


示例5: StreamWrapper

 //
 // Writeable stream constructor
 //
 public StreamWrapper(BasicStream s)
 {
     type_ = StreamType.Write;
     s_ = s;
     spos_ = s.pos();
     bytes_ = new byte[254];
     pos_ = 0;
     length_ = 0;
 }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:12,代码来源:StreamWrapper.cs


示例6: IPEndpointI

 public IPEndpointI(ProtocolInstance instance, BasicStream s)
 {
     instance_ = instance;
     host_ = s.readString();
     port_ = s.readInt();
     sourceAddr_ = null;
     connectionId_ = "";
     _hashInitialized = false;
 }
开发者ID:joshmoore,项目名称:ice,代码行数:9,代码来源:IPEndpointI.cs


示例7: OpaqueEndpointI

        public OpaqueEndpointI(short type, BasicStream s)
        {
            _type = type;
            _rawEncoding = s.getReadEncoding();
            int sz = s.getReadEncapsSize();
            _rawBytes = new byte[sz];
            s.readBlob(_rawBytes);

            calcHashValue();
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:10,代码来源:OpaqueEndpointI.cs


示例8: dumpStream

        public static void dumpStream(BasicStream stream)
        {
            int pos = stream.pos();
            stream.pos(0);

            byte[] data = new byte[stream.size()];
            stream.readBlob(data);
            dumpOctets(data);

            stream.pos(pos);
        }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:11,代码来源:TraceUtil.cs


示例9: prepareBatchRequest

 prepareBatchRequest(BasicStream os)
 {
     lock(this)
     {
         if(_exception != null)
         {
             throw _exception;
         }
         waitStreamInUse(false);
         _batchStreamInUse = true;
         _batchStream.swap(os);
     }
 }
开发者ID:joshmoore,项目名称:ice,代码行数:13,代码来源:BatchRequestQueue.cs


示例10: Outgoing

        public Outgoing(RequestHandler handler, string operation, Ice.OperationMode mode,
                        Dictionary<string, string> context, InvocationObserver observer)
        {
            _state = StateUnsent;
            _sent = false;
            _handler = handler;
            _observer = observer;
            _encoding = Protocol.getCompatibleEncoding(handler.getReference().getEncoding());
            _os = new BasicStream(_handler.getReference().getInstance(), Ice.Util.currentProtocolEncoding);

            Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(_handler.getReference().getProtocol()));

            writeHeader(operation, mode, context);
        }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:14,代码来源:Outgoing.cs


示例11: ConnectRequestHandler

 public ConnectRequestHandler(Reference @ref, Ice.ObjectPrx proxy, Ice.ObjectDelM_ del)
 {
     _reference = @ref;
     _response = _reference.getMode() == Reference.Mode.ModeTwoway;
     _proxy = (Ice.ObjectPrxHelperBase)proxy;
     _delegate = del;
     _batchAutoFlush = @ref.getInstance().initializationData().properties.getPropertyAsIntWithDefault(
         "Ice.BatchAutoFlush", 1) > 0 ? true : false;
     _initialized = false;
     _flushing = false;
     _batchRequestInProgress = false;
     _batchRequestsSize = Protocol.requestBatchHdr.Length;
     _batchStream = new BasicStream(@ref.getInstance(), _batchAutoFlush);
     _updateRequestHandler = false;
 }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:15,代码来源:ConnectRequestHandler.cs


示例12: UdpEndpointI

 public UdpEndpointI(ProtocolInstance instance, BasicStream s) :
     base(instance, s)
 {
     if(s.getReadEncoding().Equals(Ice.Util.Encoding_1_0))
     {
         s.readByte();
         s.readByte();
         s.readByte();
         s.readByte();
     }
     // Not transmitted.
     //_connect = s.readBool();
     _connect = false;
     _compress = s.readBool();
 }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:15,代码来源:UdpEndpointI.cs


示例13: CollocatedRequestHandler

        CollocatedRequestHandler(Reference @ref, Ice.ObjectAdapter adapter)
        {
            _reference = @ref;
            _dispatcher = _reference.getInstance().initializationData().dispatcher != null;
            _response = _reference.getMode() == Reference.Mode.ModeTwoway;
            _adapter = (Ice.ObjectAdapterI)adapter;

            _logger = _reference.getInstance().initializationData().logger; // Cached for better performance.
            _traceLevels = _reference.getInstance().traceLevels(); // Cached for better performance.
            _batchAutoFlushSize = @ref.getInstance().batchAutoFlushSize();
            _requestId = 0;
            _batchStreamInUse = false;
            _batchRequestNum = 0;
            _batchStream = new BasicStream(@ref.getInstance(), Ice.Util.currentProtocolEncoding);
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:15,代码来源:CollocatedRequestHandler.cs


示例14: traceRecv

        internal static void traceRecv(BasicStream str, Ice.Logger logger, TraceLevels tl)
        {
            if(tl.protocol >= 1)
            {
                int p = str.pos();
                str.pos(0);

                using(System.IO.StringWriter s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
                {
                    byte type = printMessage(s, str);

                    logger.trace(tl.protocolCat, "received " + getMessageTypeAsString(type) + " " + s.ToString());
                }
                str.pos(p);
            }
        }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:16,代码来源:TraceUtil.cs


示例15: proxyToStream

 public void proxyToStream(Ice.ObjectPrx proxy, BasicStream s)
 {
     if(proxy != null)
     {
         Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)proxy;
         Reference r = h.reference__();
         r.getIdentity().write__(s);
         r.streamWrite(s);
     }
     else
     {
         Ice.Identity ident = new Ice.Identity();
         ident.name = "";
         ident.category = "";
         ident.write__(s);
     }
 }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:17,代码来源:ProxyFactory.cs


示例16: trace

        internal static void trace(string heading, BasicStream str, Ice.Logger logger, TraceLevels tl)
        {
            if(tl.protocol >= 1)
            {
                int p = str.pos();
                str.pos(0);

                using(System.IO.StringWriter s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
                {
                    s.Write(heading);
                    printMessage(s, str);

                    logger.trace(tl.protocolCat, s.ToString());
                }
                str.pos(p);
            }
        }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:17,代码来源:TraceUtil.cs


示例17: prepareBatchRequest

        public void prepareBatchRequest(BasicStream os)
        {
            lock(this)
            {
                while(_batchRequestInProgress)
                {
                    System.Threading.Monitor.Wait(this);
                }

                if(!initialized())
                {
                    _batchRequestInProgress = true;
                    _batchStream.swap(os);
                    return;
                }
            }
            _connection.prepareBatchRequest(os);
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:18,代码来源:ConnectRequestHandler.cs


示例18: IncomingBase

        protected internal IncomingBase(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, 
                                        Ice.ObjectAdapter adapter, bool response, byte compress, int requestId)
        {
            instance_ = instance;
            responseHandler_ = handler;
            response_ = response;
            compress_ = compress;
            if(response_)
            {
                os_ = new BasicStream(instance, Ice.Util.currentProtocolEncoding);
            }

            current_ = new Ice.Current();
            current_.id = new Ice.Identity();
            current_.adapter = adapter;
            current_.con = connection;
            current_.requestId = requestId;

            cookie_ = null;
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:20,代码来源:Incoming.cs


示例19: BatchRequestQueue

        public BatchRequestQueue(Instance instance, bool datagram)
        {
            Ice.InitializationData initData = instance.initializationData();
            _interceptor = initData.batchRequestInterceptor;
            _batchStreamInUse = false;
            _batchRequestNum = 0;
            _batchStream = new BasicStream(instance, Ice.Util.currentProtocolEncoding);
            _batchStream.writeBlob(Protocol.requestBatchHdr);
            _batchMarker = _batchStream.size();
            _request = new BatchRequestI(this);

            _maxSize = instance.batchAutoFlushSize();
            if(_maxSize > 0 && datagram)
            {
                int udpSndSize = initData.properties.getPropertyAsIntWithDefault("Ice.UDP.SndSize",
                                                                                 65535 - _udpOverhead);
                if(udpSndSize < _maxSize)
                {
                    _maxSize = udpSndSize;
                }
            }
        }
开发者ID:joshmoore,项目名称:ice,代码行数:22,代码来源:BatchRequestQueue.cs


示例20: prepareBatchRequest

        public void prepareBatchRequest(BasicStream os)
        {
            _m.Lock();
            try
            {
                while(_batchRequestInProgress)
                {
                    _m.Wait();
                }

                if(!initialized())
                {
                    _batchRequestInProgress = true;
                    _batchStream.swap(os);
                    return;
                }
            }
            finally
            {
                _m.Unlock();
            }
            _connection.prepareBatchRequest(os);
        }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:23,代码来源:ConnectRequestHandler.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IceInternal.Instance类代码示例发布时间:2022-05-26
下一篇:
C# IceChatPlugin.PluginArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap