/// <summary> /// poll the client tasks from the server, and let the server know that this client is still connected /// </summary> private DataTable RemotePollClientTasks() { DataTable ResultDT = null; // TODORemoting --- The following call breaks NUnitForms Tests 'at random'! TLogging.LogAtLevel(4, "RemotePollClientTasks: About to call SessionManager.PollClientTasks..."); ResultDT = (DataTable)THttpConnector.CallWebConnector("SessionManager", "PollClientTasks", null, "binary")[0]; TLogging.LogAtLevel(4, "RemotePollClientTasks: Finished calling SessionManager.PollClientTasks..."); if (ResultDT != null) { TLogging.LogAtLevel(4, "RemotePollClientTasks: ResultDT has " + ResultDT.Rows.Count.ToString() + " rows!"); } return(ResultDT); }
/// connect the client to the server public eLoginEnum ConnectClient(String AUserName, String APassword, String AClientComputerName, String AClientIPAddress, System.Version AClientExeVersion, TClientServerConnectionType AClientServerConnectionType, out Int32 AClientID, out String AWelcomeMessage, out Boolean ASystemEnabled, out IPrincipal AUserInfo) { AWelcomeMessage = string.Empty; ASystemEnabled = true; AUserInfo = null; AClientID = -1; THttpConnector.InitConnection(TAppSettingsManager.GetValue("OpenPetra.HTTPServer")); SortedList <string, object> Parameters = new SortedList <string, object>(); Parameters.Add("username", AUserName); Parameters.Add("password", APassword); Parameters.Add("version", AClientExeVersion.ToString()); List <object> ResultList = THttpConnector.CallWebConnector("SessionManager", "LoginClient", Parameters, "list"); eLoginEnum Result = (eLoginEnum)ResultList[0]; if (Result != eLoginEnum.eLoginSucceeded) { // failed login return(Result); } AClientID = (Int32)ResultList[1]; AWelcomeMessage = (string)ResultList[2]; ASystemEnabled = (Boolean)ResultList[3]; AUserInfo = (IPrincipal)ResultList[4]; return(eLoginEnum.eLoginSucceeded); }
/// <summary> /// disconnect /// </summary> public Boolean DisconnectClient(String AReason, out String ACantDisconnectReason) { THttpConnector.CallWebConnector("SessionManager", "Logout", null, "System.Boolean"); ACantDisconnectReason = string.Empty; return(true); }