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


C# Transport.TTransport类代码示例

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


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

示例1: TFramedTransport

 public TFramedTransport(TTransport transport)
 {
     if (transport == null)
         throw new ArgumentNullException("transport");
     this.transport = transport;
     InitWriteBuffer();
 }
开发者ID:ConfusedReality,项目名称:pkg_serialization_thrift,代码行数:7,代码来源:TFramedTransport.cs

示例2: TBufferedTransport

 public TBufferedTransport(TTransport transport, int bufSize = 1024)
 {
     if (transport == null)
         throw new ArgumentNullException("transport");
     if (bufSize <= 0)
         throw new ArgumentException("bufSize", "Buffer size must be a positive number.");
     this.transport = transport;
     this.bufSize = bufSize;
 }
开发者ID:ConfusedReality,项目名称:pkg_serialization_thrift,代码行数:9,代码来源:TBufferedTransport.cs

示例3: GetClient

 public static Cassandra.Client GetClient(string keyspace, ref TTransport transport)
 {
     TTransport frameTransport = new TFramedTransport(new TSocket("localhost", 9160));
     TProtocol frameProtocol = new TBinaryProtocol(frameTransport);
     var client = new Cassandra.Client(frameProtocol, frameProtocol);
     frameTransport.Open();
     client.set_keyspace(keyspace);
     transport = frameTransport;
     return client;
 }
开发者ID:died,项目名称:logs.died.tw,代码行数:10,代码来源:ThriftTool.cs

示例4: Connection

        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        internal Connection(Server server)
        {
            Created = DateTime.Now;
            Server = server;

            TTransport socket = new TSocket(server.Host, server.Port, server.Timeout);

            _transport = new TFramedTransport(socket);
            _protocol = new TBinaryProtocol(_transport);
            _client = new Cassandra.Client(_protocol);
        }
开发者ID:rafabunga,项目名称:fluentcassandra,代码行数:15,代码来源:Connection.cs

示例5: ReturnInstance

        /// <summary>
        /// return an instance.
        /// </summary>
        /// <param name="instance"></param>
        public void ReturnInstance(TTransport instance)
        {
            if (objectPool.Count >= config.MaxIdle)
                DestoryInstance(instance);
            else
            {
                if (config.ValidateOnReturn)
                    ValidateOnReturn(instance);

                PushObject(instance);
                activedCount--;
                resetEvent.Set();
            }
        }
开发者ID:bcardi,项目名称:storm-net-adapter,代码行数:18,代码来源:ThriftPool.cs

示例6: Services

 public Services(TTransport transport)
 {
     SessionService = new SessionService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => SessionService)));
     UserService = new UserService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => UserService)));
     SettingService = new SettingService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => SettingService)));
     ChatService = new ChatService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => ChatService)));
     ChatUserInfoService = new ChatUserInfoService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => ChatUserInfoService)));
     ChatGroupService = new ChatGroupService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => ChatGroupService)));
     InboxService = new InboxService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => InboxService)));
     InboxRuleService = new InboxRuleService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => InboxRuleService)));
     ElifService = new ElifService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => ElifService)));
     SearchService = new SearchService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => SearchService)));
     NotificationService = new NotificationService.Client(new TMultiplexedProtocol(new TBinaryProtocol(new TFramedTransport(transport)), Utility.Helper.NameOf(() => NotificationService)));
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:14,代码来源:Services.cs

示例7: ReturnConnection

 public void ReturnConnection(TTransport transport)
 {
     lock (locker) {
         if (idelCount == Conf.TMaxIdel)
             DestoryInstance(transport);
         else
         {
             if (Conf.TValidateOnReturn)
                 ValidateInstance(transport);
             PushToPool(transport);
             resetEvent.Set();
         }
     }
 }
开发者ID:shentianyi,项目名称:LEONIPack,代码行数:14,代码来源:ConnectionProvider.cs

示例8: Connection

        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        internal Connection(Server server, int timeout = 0)
        {
            Created = DateTime.Now;
            Server = server;
            Timeout = timeout;

            //TcpClient client = new TcpClient(server.Host, server.Port);
            //client.NoDelay = true;
            //client.SendBufferSize = timeout;
            //client.ReceiveTimeout = timeout;

            //TTransport socket = new TSocket(client);

            TTransport socket = new TSocket(server.Host, server.Port, timeout);

            _transport = new TFramedTransport(socket);
            _protocol = new TBinaryProtocol(_transport);
            _client = new Cassandra.Client(_protocol);
        }
开发者ID:KevinT,项目名称:fluentcassandra,代码行数:23,代码来源:Connection.cs

示例9: initClient

 private void initClient()
 {
     transport = new TFramedTransport(new TSocket(SERVER_IP, SERVER_PORT, TIME_OUT));
     TProtocol protocol = new TBinaryProtocol(transport);
     client = new BigQueueService.Client(protocol);
     transport.Open();
 }
开发者ID:shshen,项目名称:bigqueue,代码行数:7,代码来源:Program.cs

示例10: Connection

        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        internal Connection(Server server, ConnectionBuilder builder)
        {
            Created = DateTime.Now;
            Server = server;

            var socket = new TSocket(server.Host, server.Port, server.Timeout * 1000);

            switch(builder.ConnectionType)
            {
                case ConnectionType.Simple:
                    _transport = socket;
                    break;

                case ConnectionType.Buffered:
                    _transport = new TBufferedTransport(socket, builder.BufferSize);
                    break;

                case ConnectionType.Framed:
                    _transport = new TFramedTransport(socket);
                    break;
            }

            _protocol = new TBinaryProtocol(_transport);
            _client = new Cassandra.Client(_protocol);
        }
开发者ID:karlgrz,项目名称:fluentcassandra,代码行数:29,代码来源:Connection.cs

示例11: InitTransportAndClient

		/// <summary>
		/// 
		/// </summary>
		private void InitTransportAndClient()
		{
			var socket = new TSocket(Server.Host, Server.Port, Server.Timeout * 1000);

			switch (ConnectionType)
			{
				case ConnectionType.Simple:
					_transport = socket;
					break;

				case ConnectionType.Buffered:
					_transport = new TBufferedTransport(socket, BufferSize);
					break;

				case ConnectionType.Framed:
					_transport = new TFramedTransport(socket);
					break;

				default:
					goto case ConnectionType.Framed;
			}

			var protocol = new TBinaryProtocol(_transport);
			_client = new Cassandra.Client(protocol);
		}
开发者ID:woolfel,项目名称:fluentcassandra,代码行数:28,代码来源:Connection.cs

示例12: GetClient

        public static Cassandra.Client GetClient()
        {
            if (_client == null)
            {
                if (_transport == null) _transport = new TFramedTransport(new TSocket("localhost", 9160));
                var client = new Cassandra.Client(new TBinaryProtocol(_transport));
                if (!_transport.IsOpen)
                {
                    try
                    {
                        _transport.Open();
                    }
                    catch (Exception e)
                    {
                        Utility.Logging("transport open fail:" + e.Message);
                    }
                }

                if (!_setKeySpace)
                {
                    client.set_keyspace(_keySpace);
                    _setKeySpace = true;
                }
                //return client;
                _client = client;
            }
            return _client;
        }
开发者ID:died,项目名称:logs.died.tw,代码行数:28,代码来源:ThriftTool.cs

示例13: EpmService

 public EpmService()
 {
     disposed = false;
     pool = new ConnectionProvider();
     transport = pool.GetConnection();
     TProtocol protocol = new TBinaryProtocol(transport);
     client = new Datahouse.Client(protocol);
 }
开发者ID:shentianyi,项目名称:LEONIPack,代码行数:8,代码来源:EpmService.cs

示例14: DNHClientComponent

        /// <summary>
        /// DNHClientComponent
        /// </summary>
        public DNHClientComponent()
        {
            InitializeComponent();

            transport = new TSocket(hostName, port);
            protocol = new TBinaryProtocol(transport);
            client = new DNHService.Client(protocol);
        }
开发者ID:PJensen,项目名称:DotNetHack,代码行数:11,代码来源:DNHClientComponent.cs

示例15: Setup

 public void Setup()
 {
     var socket = new TSocket(host, port);
     transport = new TFramedTransport(socket);
     var protocol = new TBinaryProtocol(transport);
     Client = new ZipkinCollector.Client(protocol);
     transport.Open();
 }
开发者ID:theburningmonk,项目名称:Medidata.ZipkinTracerModule,代码行数:8,代码来源:ClientProvider.cs


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