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-Tag: fanfix-swing-0.0.1~12^2~13^2~166 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=eb0d6c82905932e04acfb4066ab680ef867931ce;p=fanfix-swing.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 f0b3e3cc..92758ee6 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(); } // ------------------------------------------------------------------------