Example #1
0
 private void EXITEToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (tCPServer != null)
     {
         tCPServer.CloseServer();
     }
     Application.Exit();
 }
        private void StopListening()
        {
            // close connections to drone and client and then close the listener down

            if (clientConnected == true)
            {
                client.Close();
            }
            if (droneConnected == true)
            {
                drone.Close();
            }
            clientConnected      = false;
            droneConnected       = false;
            txtIPAddress.Enabled = true;
            txtPort.Enabled      = true;
            button1.Text         = "Start";
            IsListening          = false;
            server.CloseServer();
            server = null;
        }