Пример #1
0
        /// <summary>
        /// Handler for when the user clicks the connect button to connect to the server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void connectButton_Click(object sender, EventArgs e)
        {
            errorLabel.Text = "Connecting...";

            connectTimout          = new System.Timers.Timer(3000);
            connectTimout.Elapsed += ConnectTimout_Elapsed;
            connectTimout.Start();

            actionCallback handler = connectCallbackFunc;

            socket = Network.Connect_to_Server(handler, serverName.Text);
        }