Thrift.Transport.TSocket.Close C# (CSharp) Méthode

Close() public méthode

public Close ( ) : void
Résultat void
        public override void Close()
        {
            base.Close();
            if (client != null)
            {
                client.Close();
                client = null;
            }
        }

Usage Example

        static void Main(string[] args)
        {
            MessageObject mo1 = new MessageObject{TimeStamp = DateTime.Now, Message="begin process...."};
            LogHelper.WriteLogInfo(typeof(Program), mo1);

			TTransport transport = new TSocket("localhost", 7911);
            TProtocol protocol = new TBinaryProtocol(transport);
			ThriftCase.Client client = new ThriftCase.Client(protocol);
			transport.Open();
			Console.WriteLine("Client calls .....");
			map.Add("blog", "http://www.javabloger.com");

			client.testCase1(10, 21, "3");
			client.testCase2(map);
			client.testCase3();

			Blog blog = new Blog();
			//blog.setContent("this is blog content".getBytes());
            blog.CreatedTime = DateTime.Now.Ticks;
			blog.Id = "123456";
			blog.IpAddress = "127.0.0.1";
			blog.Topic = "this is blog topic";
			blogs.Add(blog);
			
			client.testCase4(blogs);
			
			transport.Close();
            //LogHelper.WriteLog(typeof(Program), "end process......");
            Console.ReadKey();
        }
All Usage Examples Of Thrift.Transport.TSocket::Close