diff src/org/tn5250j/framework/tn5250/DataStreamProducer.java @ 99:eda03b809f48

move blocking test from socket read to queue take
author Carl Byington <carl@five-ten-sg.com>
date Tue, 17 Jun 2014 15:13:41 -0700
parents 16e023784917
children 77ac18bc1b2f
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Tue Jun 17 11:35:01 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/DataStreamProducer.java	Tue Jun 17 15:13:41 2014 -0700
@@ -14,14 +14,11 @@
 
 import android.util.Log;
 
-import de.mud.terminal.vt320;
-
 
 public class DataStreamProducer implements Runnable {
     private static final String TAG = "DataStreamProducer";
    private tnvt                vt;
    private BufferedInputStream bin;
-   private vt320               buffer;
    private ByteArrayOutputStream baosin;
    private Thread me;
    private byte[] saveStream;
@@ -34,10 +31,9 @@
 
 
 
-   public DataStreamProducer(tnvt vt, BufferedInputStream bin, vt320 buffer, BlockingQueue<Object> queue, byte[] init) {
+   public DataStreamProducer(tnvt vt, BufferedInputStream bin, BlockingQueue<Object> queue, byte[] init) {
       this.bin    = bin;
       this.vt     = vt;
-      this.buffer = buffer;
       baosin = new ByteArrayOutputStream();
       dsq = queue;
       abyte2 = init;
@@ -167,7 +163,6 @@
       int i = 0;
 
       while(!done) {
-         if (bin.available() == 0) buffer.testChanged();
          i = bin.read();
 
          // WVL - LDC : 16/07/2003 : TR.000345
@@ -239,7 +234,6 @@
 
          if (negotiate) {
             // get the negotiation option
-            if (bin.available() == 0) buffer.testChanged();
             baosin.write(bin.read());
             vt.negotiate(rBytes);