Beispiel #1
0
        private void connectButton_Click(object sender, EventArgs e)
        {
            //127.0.0.1
            Int32  serverPort = Convert.ToInt32(serverPortText.Text);
            String serverIP   = serverIPText.Text;

            if ((serverPort != 0) && (serverIP.Length >= 9))
            {
                if (TcpConnector.ConnectToTCP(serverIP, serverPort))
                {
                    statusLabel.Text = "Connected";

                    if (TcpConnector.Sockets.Count == 1)
                    {
                        DrawMandelbrot(ZoomIteration, 0);
                        ZoomIteration++;
                    }
                }
                else
                {
                    statusLabel.Text = "Error";
                }
            }
            else
            {
                statusLabel.Text = "Wrong data";
            }
        }
Beispiel #2
0
        private void ComputeRegular(int i, int scktID)
        {
            string createdFilePath = "../../json/created[" + i + "].json";
            string message         = CreateMandelbrotRequestObject(createdFilePath);

            TcpConnector.Send(scktID, createdFilePath);

            Bitmap bitmap = TcpConnector.Recieve(scktID);

            bitmap.Save("saves/save[" + i + "].png", ImageFormat.Png);
            pictureBox1.Image = bitmap;
        }
Beispiel #3
0
        private static void RequestParalel(int scktID, int i)
        {
            TakenSocketIds.Add(scktID);

            string createdFilePath = "../../json/created[" + i + "].json";

            TcpConnector.Send(scktID, createdFilePath);
            Bitmap bitmap = TcpConnector.Recieve(scktID);

            bitmap.Save("saves/save[" + i + "].png", ImageFormat.Png);

            TakenSocketIds.Remove(scktID);
        }