예제 #1
0
        /// <summary>
        /// Event handler for whenever the user requests ending the current server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void stopServerMenu_Click(object sender, EventArgs e)
        {
            chessServer.Stop();
            chessServer = null;

            stopServerMenu.Visible       = false;
            startServerMenu.Visible      = true;
            localhostConnectMenu.Visible = false;
        }
예제 #2
0
        /// <summary>
        /// Event handler for whenever the user requests starting a new server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void startServerMenu_ClickAsync(object sender, EventArgs e)
        {
            IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, 65535);

            chessServer = new ChessServer(endPoint);
            chessServer.Start();
            chessServer.Run();

            stopServerMenu.Visible       = true;
            startServerMenu.Visible      = false;
            localhostConnectMenu.Visible = true;
        }