diff src/org/tn5250j/framework/tn5250/DataStreamProducer.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 c438c2ff0052
children 24186858750f
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Tue Sep 16 11:12:45 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Tue Sep 16 16:22:41 2014 -0700
@@ -146,6 +146,12 @@
         int i = 0;
 
         while (!done) {
+            try {
+                if (bin.available() == 0) dsq.put(new Integer(0));  // trigger buffer.testChanged()
+            }
+            catch (Exception ex) {
+                Log.w(TAG, "readIncoming error " + ex.getMessage());
+            }
             i = bin.read();
 
             // WVL - LDC : 16/07/2003 : TR.000345
@@ -218,6 +224,12 @@
 
         if (negotiate) {
             // get the negotiation option
+            try {
+                if (bin.available() == 0) dsq.put(new Integer(0));  // trigger buffer.testChanged()
+            }
+            catch (Exception ex) {
+                Log.w(TAG, "readIncoming error " + ex.getMessage());
+            }
             baosin.write(bin.read());
             vt.negotiate(rBytes);
             return null;