BVB Source Codes

SuperSocket v1.6.6 Show FROZ.cs Source code

Return Download SuperSocket v1.6.6: download FROZ.cs Source code - Download SuperSocket v1.6.6 Source code - Type:.cs
  1. 锘縰sing System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SuperSocket.SocketBase.Command;
  6. using SuperSocket.SocketBase.Protocol;
  7.  
  8. namespace SuperSocket.QuickStart.RemoteProcessService.Command
  9. {
  10.     public class FROZ : StringCommandBase<RemoteProcessSession>
  11.     {
  12.         #region CommandBase<RemotePrcessSession> Members
  13.  
  14.         public override void ExecuteCommand(RemoteProcessSession session, StringRequestInfo requestInfo)
  15.         {
  16.             var server = session.AppServer;
  17.  
  18.             string firstParam = requestInfo.GetFirstParam();
  19.  
  20.             if (string.IsNullOrEmpty(firstParam))
  21.             {
  22.                 session.Send("Invalid parameter!");
  23.                 return;
  24.             }
  25.  
  26.             var param = requestInfo[1];
  27.  
  28.             if ("list".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  29.             {
  30.                 StringBuilder sb = new StringBuilder();
  31.                 foreach (var p in server.GetFrozedProcesses())
  32.                 {
  33.                     sb.AppendLine(p);
  34.                 }
  35.                 sb.AppendLine();
  36.  
  37.                 session.Send(sb.ToString());
  38.                 return;
  39.             }
  40.             else if ("add".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  41.             {
  42.                 if (string.IsNullOrEmpty(param))
  43.                 {
  44.                     session.Send("Invalid parameter!");
  45.                     return;
  46.                 }
  47.  
  48.                 server.AddFrozedProcess(param);
  49.                 session.Send(string.Format("Frozed process {0} has been added!", param));
  50.                 return;
  51.             }
  52.             else if ("remove".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  53.             {
  54.                 if (string.IsNullOrEmpty(param))
  55.                 {
  56.                     session.Send("Invalid parameter!");
  57.                     return;
  58.                 }
  59.  
  60.                 server.RemoveFrozedProcess(param);
  61.                 session.Send(string.Format("Frozed process {0} has been removed!", param));
  62.                 return;
  63.             }
  64.             else if ("clear".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  65.             {
  66.                 server.ClearFrozedProcess();
  67.                 session.Send("All frozed process have been removed!");
  68.                 return;
  69.             }
  70.             else if ("stop".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  71.             {
  72.                 server.StopFroze();
  73.                 session.Send("Frozing has been stopped!");
  74.                 return;
  75.             }
  76.             else if ("start".Equals(firstParam, StringComparison.OrdinalIgnoreCase))
  77.             {
  78.                 server.StartFroze();
  79.                 session.Send("Frozing has been started!");
  80.                 return;
  81.             }
  82.         }
  83.  
  84.         #endregion
  85.     }
  86. }
  87.  
downloadFROZ.cs Source code - Download SuperSocket v1.6.6 Source code
Related Source Codes/Software:
Students' basic information input program v2.0 - 1, the program is based on. net4.0 framework and d... 2016-08-19
Student information input system v2.0 - 1, the program is based on. net4.0 framework and d... 2016-08-19
Baidu handwriting input source v1.0 - Baidu handwriting input method source code, no nee... 2016-08-19
Rui bao tong v1.0 JAVA version of B2B e-commerce system - Rainbow B2B system developed using the popular JAV... 2016-08-19
HTML + javascript lottery system v2.1.1 HTA - Technology QQ:838341952 HTML+JS lottery system sta... 2016-08-19
Cloud on the CMS (SyCms) v1.95 - Add menus and blocks the system style functionalit... 2016-08-19
1.0 housing, rental housing sale platform - Rent housing rent out platform is a very typical r... 2016-08-19
Deng Xi v2.4 website help system - Deng Xi website help system is a very useful help ... 2016-08-19
Address book v1.0 FaLiang three layer - This Demo is a three layer address book source cod... 2016-08-19
Ray speed v7.0 wage query system - To modify the software to conduct a comprehensive ... 2016-08-19
MTStatusBarOverlay - A custom iOS status bar overlay seen in Apps like ... 2017-05-12
blueprint - Reverse engineer server configuration ... 2017-05-12
PullToRefresh - A simple iPhone TableViewController for adding the... 2017-05-12
mrjob - Run MapReduce jobs on Hadoop or Amazon Web Service... 2017-05-11
wax - Wax is now being maintained by alibaba ... 2017-05-11
ledisdb - a high performance NoSQL powered by Go ... 2017-05-11
d3-cloud - Create word clouds in JavaScript. ... 2017-05-11
react-makes-you-sad - Here's a flowchart to make you happy again! 2017-05-11
flat-surface-shader - Flat Surface Shader for rendering lit triangles to... 2017-05-11
flat-surface-shader - Flat Surface Shader for rendering lit triangles to... 2017-05-11

 Back to top