Programm wird nun beim schließen der Verbindung beendet
This commit is contained in:
@@ -39,6 +39,7 @@ public class Program
|
|||||||
Term.PrintLine(line);
|
Term.PrintLine(line);
|
||||||
}
|
}
|
||||||
SenderThread.Abort();
|
SenderThread.Abort();
|
||||||
|
Term.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doSend ()
|
public void doSend ()
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ public class Terminal
|
|||||||
private String InputBuffer = "";
|
private String InputBuffer = "";
|
||||||
private bool AcceptInput = false;
|
private bool AcceptInput = false;
|
||||||
private int OutLinePos;
|
private int OutLinePos;
|
||||||
|
private Thread catchInputThread;
|
||||||
|
|
||||||
public Terminal ()
|
public Terminal ()
|
||||||
{
|
{
|
||||||
OutLinePos = Console.CursorTop;
|
OutLinePos = Console.CursorTop;
|
||||||
Thread catchInputThread = new Thread (new ThreadStart (this.CatchInput));
|
catchInputThread = new Thread (new ThreadStart (this.CatchInput));
|
||||||
catchInputThread.Start ();
|
catchInputThread.Start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,5 +92,10 @@ public class Terminal
|
|||||||
Console.SetCursorPosition (0, OutLinePos);
|
Console.SetCursorPosition (0, OutLinePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Close ()
|
||||||
|
{
|
||||||
|
catchInputThread.Abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user