comparison 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
comparison
equal deleted inserted replaced
391:bcbd579253a1 392:7ac1a0b02f44
144 baosin.reset(); 144 baosin.reset();
145 int j = -1; 145 int j = -1;
146 int i = 0; 146 int i = 0;
147 147
148 while (!done) { 148 while (!done) {
149 try {
150 if (bin.available() == 0) dsq.put(new Integer(0)); // trigger buffer.testChanged()
151 }
152 catch (Exception ex) {
153 Log.w(TAG, "readIncoming error " + ex.getMessage());
154 }
149 i = bin.read(); 155 i = bin.read();
150 156
151 // WVL - LDC : 16/07/2003 : TR.000345 157 // WVL - LDC : 16/07/2003 : TR.000345
152 // The inStream return -1 when end-of-stream is reached. This 158 // The inStream return -1 when end-of-stream is reached. This
153 // happens e.g. when the connection is closed from the AS/400. 159 // happens e.g. when the connection is closed from the AS/400.
216 dump(rBytes); 222 dump(rBytes);
217 } 223 }
218 224
219 if (negotiate) { 225 if (negotiate) {
220 // get the negotiation option 226 // get the negotiation option
227 try {
228 if (bin.available() == 0) dsq.put(new Integer(0)); // trigger buffer.testChanged()
229 }
230 catch (Exception ex) {
231 Log.w(TAG, "readIncoming error " + ex.getMessage());
232 }
221 baosin.write(bin.read()); 233 baosin.write(bin.read());
222 vt.negotiate(rBytes); 234 vt.negotiate(rBytes);
223 return null; 235 return null;
224 } 236 }
225 237