Beispiel #1
0
        public TdirResult Query(int appID, string[] ipList, int[] portList, string lastSuccessIP, int lastSuccessPort, string openID, bool isOnlyTACC)
        {
            if (ipList == null || ipList.Length == 0)
            {
                this.mErrorCode   = TdirResult.ParamError;
                this.mErrorString = "the input IP list is null or empty";
                this.TdirLog("the input IP list is null or empty");
                return(TdirResult.ParamError);
            }
            if (portList == null || portList.Length == 0)
            {
                this.mErrorCode   = TdirResult.ParamError;
                this.mErrorString = "the input port list is null or empty";
                this.TdirLog("the input port list is null or empty");
                return(TdirResult.ParamError);
            }
            this.mErrorCode           = TdirResult.TdirNoError;
            this.mErrorString         = "no error";
            this.isServiceTableEnable = false;
            this.m_appID           = appID;
            this.m_ipList          = ipList;
            this.m_portList        = portList;
            this.m_lastSuccessIP   = lastSuccessIP;
            this.m_lastSuccessPort = lastSuccessPort;
            this.m_openID          = openID;
            this.m_treenodes       = new List <TdirTreeNode>();
            this.m_treeRoleInfoDic.Clear();
            string ipList2   = string.Join("|", ipList);
            string portList2 = string.Join("|", this.ToStringArray(portList));

            this.Dump();
            return(ApolloTdir.tcls_init(base.ObjectId, appID, ipList2, portList2, lastSuccessIP, Convert.ToString(lastSuccessPort), openID, isOnlyTACC));
        }
Beispiel #2
0
 public TdirResult GetErrorCode()
 {
     if (this.mErrorCode == TdirResult.TdirNoError)
     {
         return(ApolloTdir.tcls_get_errCode(base.ObjectId));
     }
     return(this.mErrorCode);
 }
Beispiel #3
0
 public string GetErrorString()
 {
     if ("no error" == this.mErrorString)
     {
         IntPtr intPtr = ApolloTdir.tcls_get_errString(base.ObjectId);
         return(Marshal.PtrToStringAnsi(intPtr));
     }
     return(this.mErrorString);
 }
Beispiel #4
0
 public TdirResult GetTreeNodes(ref List <TdirTreeNode> nodeList)
 {
     if (ApolloTdir.tcls_status(base.ObjectId) == TdirResult.RecvDone)
     {
         nodeList = this.m_treenodes;
         return(TdirResult.TdirNoError);
     }
     return(TdirResult.NeedRecvDoneStatus);
 }
Beispiel #5
0
 public TdirResult Recv(int timeout)
 {
     if (this.Status() == TdirResult.WaitForQuery)
     {
         return(ApolloTdir.tcls_query(base.ObjectId, timeout));
     }
     if (this.Status() == TdirResult.WaitForRecv)
     {
         return(ApolloTdir.tcls_recv(base.ObjectId, timeout));
     }
     return(this.Status());
 }
Beispiel #6
0
 public TdirResult GetServiceTable(ref TdirServiceTable table)
 {
     if (ApolloTdir.tcls_status(base.ObjectId) != TdirResult.RecvDone)
     {
         return(TdirResult.NeedRecvDoneStatus);
     }
     if (this.isServiceTableEnable)
     {
         table = this.mServiceTable;
         return(TdirResult.TdirNoError);
     }
     return(TdirResult.NoServiceTable);
 }
Beispiel #7
0
 public TdirResult DisableLog()
 {
     this.mLog = false;
     return(ApolloTdir.tcls_disable_log(base.ObjectId));
 }
Beispiel #8
0
 public TdirResult EnableLog()
 {
     this.mLog = true;
     return(ApolloTdir.tcls_enable_log(base.ObjectId));
 }
Beispiel #9
0
 public TdirResult SetSvrTimeout(int timeout)
 {
     return(ApolloTdir.tcls_set_svr_timeout(base.ObjectId, timeout));
 }
Beispiel #10
0
 public TdirResult Status()
 {
     return(ApolloTdir.tcls_status(base.ObjectId));
 }
Beispiel #11
0
 public TdirResult SetProtocolVersion(int version)
 {
     return(ApolloTdir.tcls_set_protocol_version(base.ObjectId, version));
 }