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


C# BasicStream.writeShort方法代码示例

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


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

示例1: streamWrite

 //
 // Marshal the endpoint
 //
 public override void streamWrite(BasicStream s)
 {
     s.writeShort(_type);
     s.startWriteEncaps(_rawEncoding, Ice.FormatType.DefaultFormat);
     s.writeBlob(_rawBytes);
     s.endWriteEncaps();
 }
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:10,代码来源:OpaqueEndpointI.cs

示例2: streamWrite

 //
 // Marshal the endpoint
 //
 public override void streamWrite(BasicStream s)
 {
     s.writeShort(Ice.TCPEndpointType.value);
     s.startWriteEncaps();
     s.writeString(_host);
     s.writeInt(_port);
     s.writeInt(_timeout);
     s.writeBool(_compress);
     s.endWriteEncaps();
 }
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:13,代码来源:TcpEndpointI.cs

示例3: create

        public EndpointI create(string str, bool oaEndpoint)
        {
            string[] arr = IceUtilInternal.StringUtil.splitString(str, " \t\r\n");
            if(arr == null)
            {
                Ice.EndpointParseException e = new Ice.EndpointParseException();
                e.str = "mismatched quote";
                throw e;
            }

            if(arr.Length == 0)
            {
                Ice.EndpointParseException e = new Ice.EndpointParseException();
                e.str = "value has no non-whitespace characters";
                throw e;
            }

            List<string> v = new List<string>(arr);
            string protocol = v[0];
            v.RemoveAt(0);

            if(protocol.Equals("default"))
            {
                protocol = instance_.defaultsAndOverrides().defaultProtocol;
            }

            EndpointFactory factory = null;

            lock(this)
            {
                for(int i = 0; i < _factories.Count; i++)
                {
                    EndpointFactory f = _factories[i];
                    if(f.protocol().Equals(protocol))
                    {
                        factory = f;
                    }
                }
            }

            if(factory != null)
            {
                EndpointI e = factory.create(v, oaEndpoint);
                if(v.Count > 0)
                {
                    Ice.EndpointParseException ex = new Ice.EndpointParseException();
                    ex.str = "unrecognized argument `" + v[0] + "' in endpoint `" + str + "'";
                    throw ex;
                }
                return e;

                // Code below left in place for debugging.

                /*
                EndpointI e = f.create(s.Substring(m.Index + m.Length), oaEndpoint);
                BasicStream bs = new BasicStream(instance_, true);
                e.streamWrite(bs);
                Buffer buf = bs.getBuffer();
                buf.b.position(0);
                short type = bs.readShort();
                EndpointI ue = new IceInternal.OpaqueEndpointI(type, bs);
                System.Console.Error.WriteLine("Normal: " + e);
                System.Console.Error.WriteLine("Opaque: " + ue);
                return e;
                */
            }

            //
            // If the stringified endpoint is opaque, create an unknown endpoint,
            // then see whether the type matches one of the known endpoints.
            //
            if(protocol.Equals("opaque"))
            {
                EndpointI ue = new OpaqueEndpointI(v);
                if(v.Count > 0)
                {
                    Ice.EndpointParseException ex = new Ice.EndpointParseException();
                    ex.str = "unrecognized argument `" + v[0] + "' in endpoint `" + str + "'";
                    throw ex;
                }
                factory = get(ue.type());
                if(factory != null)
                {
                    //
                    // Make a temporary stream, write the opaque endpoint data into the stream,
                    // and ask the factory to read the endpoint data from that stream to create
                    // the actual endpoint.
                    //
                    BasicStream bs = new BasicStream(instance_, Ice.Util.currentProtocolEncoding);
                    bs.writeShort(ue.type());
                    ue.streamWrite(bs);
                    Buffer buf = bs.getBuffer();
                    buf.b.position(0);
                    buf.b.limit(buf.size());
                    bs.readShort(); // type
                    bs.startReadEncaps();
                    EndpointI e = factory.read(bs);
                    bs.endReadEncaps();
                    return e;
                }
//.........这里部分代码省略.........
开发者ID:joshmoore,项目名称:ice,代码行数:101,代码来源:EndpointFactoryManager.cs

示例4: streamWrite

 //
 // Marshal the endpoint
 //
 public override void streamWrite(BasicStream s)
 {
     s.writeShort(_type);
     s.startWriteEncaps();
     s.writeBlob(_rawBytes);
     s.endWriteEncaps();
 }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:10,代码来源:OpaqueEndpointI.cs

示例5: streamWrite

 //
 // Marshal the endpoint
 //
 public override void streamWrite(BasicStream s)
 {
     s.writeShort(Ice.UDPEndpointType.value);
     s.startWriteEncaps();
     s.writeString(_host);
     s.writeInt(_port);
     if(s.getWriteEncoding().Equals(Ice.Util.Encoding_1_0))
     {
         Ice.Util.Protocol_1_0.write__(s);
         Ice.Util.Encoding_1_0.write__(s);
     }
     // Not transmitted.
     //s.writeBool(_connect);
     s.writeBool(_compress);
     s.endWriteEncaps();
 }
开发者ID:sbesson,项目名称:zeroc-ice,代码行数:19,代码来源:UdpEndpointI.cs

示例6: streamWrite

 //
 // Marshal the endpoint
 //
 public override void streamWrite(BasicStream s)
 {
     s.writeShort(Ice.UDPEndpointType.value);
     s.startWriteEncaps();
     s.writeString(_host);
     s.writeInt(_port);
     s.writeByte(_protocolMajor);
     s.writeByte(_protocolMinor);
     s.writeByte(_encodingMajor);
     s.writeByte(_encodingMinor);
     // Not transmitted.
     //s.writeBool(_connect);
     s.writeBool(_compress);
     s.endWriteEncaps();
 }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:18,代码来源:UdpEndpointI.cs


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