From: Kevin Lamonte Date: Thu, 28 Feb 2019 21:58:44 +0000 (-0600) Subject: #38 exit if there was an error writing to the socket X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=eb0d6c82905932e04acfb4066ab680ef867931ce;p=fanfix-jexer.git #38 exit if there was an error writing to the socket --- diff --git a/src/jexer/backend/ECMA48Terminal.java b/src/jexer/backend/ECMA48Terminal.java index f0b3e3c..92758ee 100644 --- a/src/jexer/backend/ECMA48Terminal.java +++ b/src/jexer/backend/ECMA48Terminal.java @@ -1455,6 +1455,11 @@ public class ECMA48Terminal extends LogicalScreen events.clear(); } + if (output.checkError()) { + // This is EOF. + done = true; + } + // Wait 20 millis for more data Thread.sleep(20); } @@ -1466,7 +1471,11 @@ public class ECMA48Terminal extends LogicalScreen done = true; } } // while ((done == false) && (stopReaderThread == false)) - // System.err.println("*** run() exiting..."); System.err.flush(); + + // TODO: pass an event up to TApplication to tell it this Backend is + // done. + + System.err.println("*** run() exiting..."); System.err.flush(); } // ------------------------------------------------------------------------