コード例 #1
0
        static void Main(string[] args)
        {
            var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            System.Console.WriteLine("Client, Version " + version);
            try
            {
                if (args.Length == 0)
                {
                    System.Console.WriteLine("No Port provided, using default value");
                    NetworkConnector.SetUpConnection(442);
                }
                else
                {
                    System.Console.WriteLine("Using provided port: " + args[0]);
                    NetworkConnector.SetUpConnection(Convert.ToInt32(args[0]));
                }

                System.Console.WriteLine("Connected.");


                Mandelbrot.GenerateMandelBrotParams();
                while (true)
                {
                    Mandelbrot.DoMandelBrot();
                }
            }

            catch (Exception e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine(e.Message);
                return;
            }
        }
コード例 #2
0
 public static void DoMandelBrot()
 {
     for (int i = 0; i < 4; i++)
     {
         NetworkConnector.SendData("START");
         var toSend = Encoding.UTF8.GetString(Mandelbrot.GenerateMandelbrotSet(complexity[i], iterations[i]));
         NetworkConnector.SendData("STOP");
         NetworkConnector.SendData(complexity[i], iterations[i], toSend);
     }
 }