예제 #1
0
        /// <summary>
        /// Set the server settings that declared as object fields
        /// </summary>
        private static void SetupServer()
        {
            Console.WriteLine("Setting up server...");
            serverSocket.Bind(new IPEndPoint(IPAddress.Any, PORT));
            serverSocket.Listen(0);
            serverSocket.BeginAccept(AcceptCallback, null);
            Config c = new Config();
            Server s = new Server();

            m.Mat    = s.GenerateMatrix(c.getVertices());
            mNew.Mat = new int[c.getVertices(), c.getVertices()];
            Console.WriteLine("Generated graph vertices: {0}", c.getVertices());
            Console.WriteLine("Waiting for {0} clients to send matrix", c.getClients());
            Console.WriteLine("Server setup complete");
        }