Exemple #1
0
 public static DataPackage Execute(string actionID, DataPackage paramTable = null)
 {
     if (_connector == null)
     {
         throw new InvalidOperationException("Use Logon(ConnectorOptions connectorOptions) before Execute");
     }
     Logon(_connector.ConnectorOptions);
     try
     {
         return(_connector.Execute(actionID, paramTable));
     }
     catch (System.IO.IOException)
     {
         //For reuse socket
         Logon(_connector.ConnectorOptions);
         return(_connector.Execute(actionID, paramTable));
     }
 }
Exemple #2
0
 private void TCPConnectorConnectTest()
 {
     using (FileLog l = new FileLog("TCPConnectorConnectTest", new FileLogSettings()
     {
         DateFolderMask = "yyyy-MM-dd"
     }))
         using (TCPConnector connector = TCPConnector.Create())
         {
             connector.Connect("Test", "@TestPassword");
             l.Debug("Start performance test for logins");
             int i = 0;
             for (i = 0; i < 1000; i++)
             {
                 var dr = connector.Execute("Sys.Select", new DataPackage(new string[] { "ParamName", "ParamValue" },
                                                                          new object[] { "_connectionName", "banklocal" }));
                 //string s = (string)dr["ObjectSchema"];
             }
             l.Debug($"End performance test for {i} logins");
         }
 }