diff src/org/tn5250j/framework/tn5250/tnvt.java @ 392:7ac1a0b02f44

add test buffer changed when input stream runs dry, similar to async test
author Carl Byington <carl@five-ten-sg.com>
date Tue, 16 Sep 2014 16:22:41 -0700
parents d26faad31533
children d3c5480e8441
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/tnvt.java	Tue Sep 16 11:12:45 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/tnvt.java	Tue Sep 16 16:22:41 2014 -0700
@@ -832,12 +832,11 @@
 
     private final void setInvited() {
         Log.d(TAG, "invited");
-
         if (!screen52.isStatusErrorCode())
             screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_NOTINHIBITED,
                                                 ScreenOIA.OIA_LEVEL_INPUT_INHIBITED);
-
         invited = true;
+        buffer.testChanged();
     }
 
     // WVL - LDC : 05/08/2005 : TFX.006253 - Support STRPCCMD
@@ -986,6 +985,12 @@
         while (keepTrucking) {
             try {
                 Object e = dsq.take();
+
+                if ((e instanceof Integer) && ((Integer)e == 0)) {
+                    buffer.testChanged();
+                    continue;
+                };
+
                 bk.initialize((byte[])e);
             }
             catch (InterruptedException ie) {
@@ -996,7 +1001,6 @@
 
             invited = false;
             screen52.setCursorActive(false);
-
             if (bk == null) continue;
 
             switch (bk.getOpCode()) {
@@ -1105,7 +1109,6 @@
             if (pendingUnlock && !screen52.isStatusErrorCode()) {
                 screen52.getOIA().setKeyBoardLocked(false);
                 pendingUnlock = false;
-                buffer.testChanged();
             }
 
             if (cursorOn && !screen52.getOIA().isKeyBoardLocked()) {