NetHadoop.FSClient.Connect C# (CSharp) Method

Connect() public method

public Connect ( Thrift.Transport.TBufferedTransport &tsport ) : ThriftHadoopFileSystem.Client
tsport Thrift.Transport.TBufferedTransport
return ThriftHadoopFileSystem.Client
        public ThriftHadoopFileSystem.Client Connect(out TBufferedTransport tsport)
        {
            TSocket hadoop_socket = new TSocket(HostIP, HostPort);

               //hadoop_socket.Timeout = 10000;// Ten seconds

               tsport = new TBufferedTransport(hadoop_socket);

               TBinaryProtocol hadoop_protocol = new TBinaryProtocol(tsport, false, false);

               ThriftHadoopFileSystem.Client client = new ThriftHadoopFileSystem.Client(hadoop_protocol);
               try
               {
               tsport.Open();
               return client;
               }
               catch (Exception ee)
               {
               logger.Error("打开连接失败!", ee);
               tsport = null;
               return null;
               }
        }