當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。