Advertisement
Deerenaros

Program.Main

Oct 5th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 KB | None | 0 0
  1. // server.Program
  2. using PABCSystem;
  3. using System;
  4. using System.Net;
  5. using System.Net.Sockets;
  6. using System.Threading.Tasks;
  7.  
  8. public static void $Main()
  9. {
  10.     server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  11.     server.Bind(new IPEndPoint(IPAddress.Parse("0.0.0.0"), 4120));
  12.     server.Listen(100);
  13.     PABCSystem.PABCSystem.Writeln("Bound to the port 4120. Ready!");
  14.     int num = 0;
  15.     if (handlers != null)
  16.     {
  17.         num = handlers.Length;
  18.     }
  19.     int newSize = 0;
  20.     Array.Resize(ref handlers, newSize);
  21.     if (!$InParallelSection)
  22.     {
  23.         $for_class0 @object = new $for_class0();
  24.         if (!PABCSystem.PABCSystem.OMP_NESTED)
  25.         {
  26.             $InParallelSection = true;
  27.         }
  28.         Parallel.For(1, 1410065409, @object.Method);
  29.         if (!PABCSystem.PABCSystem.OMP_NESTED)
  30.         {
  31.             $InParallelSection = false;
  32.         }
  33.         return;
  34.     }
  35.     int num2 = 1410065408;
  36.     int num3 = 1;
  37.     if (num3 > num2)
  38.     {
  39.         return;
  40.     }
  41.     while (true)
  42.     {
  43.         handler = server.Accept();
  44.         int num4 = 0;
  45.         if (handlers != null)
  46.         {
  47.             num4 = handlers.Length;
  48.         }
  49.         int newSize2 = handlers.Length + 1;
  50.         Array.Resize(ref handlers, newSize2);
  51.         int num5 = handlers.Length - 1;
  52.         handlers[num5] = handler;
  53.         processUser(num5);
  54.         if (num3 < num2)
  55.         {
  56.             num3++;
  57.             continue;
  58.         }
  59.         break;
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement