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)); }
public TdirResult GetErrorCode() { if (this.mErrorCode == TdirResult.TdirNoError) { return(ApolloTdir.tcls_get_errCode(base.ObjectId)); } return(this.mErrorCode); }
public string GetErrorString() { if ("no error" == this.mErrorString) { IntPtr intPtr = ApolloTdir.tcls_get_errString(base.ObjectId); return(Marshal.PtrToStringAnsi(intPtr)); } return(this.mErrorString); }
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); }
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()); }
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); }
public TdirResult DisableLog() { this.mLog = false; return(ApolloTdir.tcls_disable_log(base.ObjectId)); }
public TdirResult EnableLog() { this.mLog = true; return(ApolloTdir.tcls_enable_log(base.ObjectId)); }
public TdirResult SetSvrTimeout(int timeout) { return(ApolloTdir.tcls_set_svr_timeout(base.ObjectId, timeout)); }
public TdirResult Status() { return(ApolloTdir.tcls_status(base.ObjectId)); }
public TdirResult SetProtocolVersion(int version) { return(ApolloTdir.tcls_set_protocol_version(base.ObjectId, version)); }