Example #1
0
 public static void StopSPServer(out SqlInt32 res)
 {
     res = 0;
     using (SqlConnection conn = new SqlConnection("context connection=true"))
     {
         try
         {
             conn.Open();
             lock (m_cs)
             {
                 if (Plugin != null)
                 {
                     if (ServerCoreLoader.IsRunning())
                     {
                         ServerCoreLoader.SetOnIdle(null);
                         Plugin.StopSocketProServer();
                         res += 1;
                     }
                     Plugin.Dispose();
                     Plugin = null;
                     res   += 1;
                 }
             }
         }
         catch (Exception err)
         {
             UConfig.LogMsg(err.Message, "USqlStream::StopSPServer", 57); //line 57
         }
         finally
         {
             conn.Close();
         }
     }
 }
Example #2
0
 public static void StopSPServer(out SqlInt32 res)
 {
     res = 0;
     using (SqlConnection conn = new SqlConnection("context connection=true"))
     {
         try
         {
             conn.Open();
             lock (m_cs)
             {
                 if (IsRunning())
                 {
                     Plugin.StopSocketProServer();
                     res += 10;
                 }
                 Plugin = null;
             }
             res += 1;
         }
         catch (Exception err)
         {
             LogError(conn, err.Message);
         }
         finally
         {
             conn.Close();
         }
     }
 }