diff src/org/tn5250j/framework/tn5250/DataStreamProducer.java @ 214:3e68cb17c0b6

socket runs dry sends flag to tnvt to call testChanged()
author Carl Byington <carl@five-ten-sg.com>
date Mon, 07 Jul 2014 15:09:22 -0700
parents 77ac18bc1b2f
children c438c2ff0052
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Mon Jul 07 12:36:01 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Mon Jul 07 15:09:22 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;