Programm wird nun beim schließen der Verbindung beendet

This commit is contained in:
2014-03-27 10:53:47 +01:00
parent ab2da9336f
commit 1023627cdd
2 changed files with 8 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ public class Program
Term.PrintLine(line);
}
SenderThread.Abort();
Term.Close();
}
public void doSend ()

View File

@@ -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();
}
}