From 1023627cdd4dab603d1b4dae1ceb1628cea785e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 27 Mar 2014 10:53:47 +0100 Subject: [PATCH] =?UTF-8?q?Programm=20wird=20nun=20beim=20schlie=C3=9Fen?= =?UTF-8?q?=20der=20Verbindung=20beendet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dummyclient_manuel/Program.cs | 1 + dummyclient_manuel/Terminal.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dummyclient_manuel/Program.cs b/dummyclient_manuel/Program.cs index 0e61037..4989c69 100644 --- a/dummyclient_manuel/Program.cs +++ b/dummyclient_manuel/Program.cs @@ -39,6 +39,7 @@ public class Program Term.PrintLine(line); } SenderThread.Abort(); + Term.Close(); } public void doSend () diff --git a/dummyclient_manuel/Terminal.cs b/dummyclient_manuel/Terminal.cs index ed82013..5846f1c 100644 --- a/dummyclient_manuel/Terminal.cs +++ b/dummyclient_manuel/Terminal.cs @@ -10,11 +10,12 @@ public class Terminal private String InputBuffer = ""; private bool AcceptInput = false; private int OutLinePos; + private Thread catchInputThread; public Terminal () { OutLinePos = Console.CursorTop; - Thread catchInputThread = new Thread (new ThreadStart (this.CatchInput)); + catchInputThread = new Thread (new ThreadStart (this.CatchInput)); catchInputThread.Start (); } @@ -91,5 +92,10 @@ public class Terminal Console.SetCursorPosition (0, OutLinePos); } } + + public void Close () + { + catchInputThread.Abort(); + } }