title: Android AsyncTask publishProgress does not call onProgressUpdate
body: <p>I have the following code to run a client socket connection in a asynctask:</p>
  
  <pre><code>@Override
  protected Boolean doInBackground(Void... params) { //This runs on a different thread
      boolean result = false;
      try {
          Log.i("AsyncTask", "doInBackground: Creating socket");
          SocketAddress sockaddr = new InetSocketAddress("192.168.1.115", 9090);
          nsocket = new Socket();
          nsocket.connect(sockaddr, 5000); //10 second connection timeout
          if (nsocket.isConnected()) { 
              nis = nsocket.getInputStream();
              wr = new BufferedWriter(new OutputStreamWriter(nsocket.getOutputStream()));
              Log.i("AsyncTask", "doInBackground: Socket created, streams assigned");
              Log.i("AsyncTask", "doInBackground: Waiting for inital data...");
              sockState = true;
              byte[] buffer = new byte[4096];
              int read = nis.read(buffer, 0, 4096); //This is blocking
              while(read != -1){
                  byte[] tempdata = new byte[read];
                  System.arraycopy(buffer, 0, tempdata, 0, read);
                  publishProgress(tempdata);
                  Log.i("AsyncTask", "doInBackground: Got some data");
                  read = nis.read(buffer, 0, 4096); //This is blocking
              }
          }
      } catch (IOException e) {
          e.printStackTrace();
          Log.i("AsyncTask", "doInBackground: IOException");
          result = true;
      } catch (Exception e) {
          e.printStackTrace();
          Log.i("AsyncTask", "doInBackground: Exception");
          result = true;
      } finally {
          try {
              nis.close();
              wr.close();
              nsocket.close();
          } catch (IOException e) {
              e.printStackTrace();
          } catch (Exception e) {
              e.printStackTrace();
          }
          Log.i("AsyncTask", "doInBackground: Finished");
      }
      return result;
  }
  
  @Override
  protected void onProgressUpdate(byte[]... values) {
       Log.d("KMC.NetworkTask", String.valueOf(values[0]));
      if (values.length &gt; 0) {
          Log.d("KMC.NetworkTask", "onProgressUpdate: " + values[0].length + " bytes received.");
          result = new String(values[0]);
      }
  }
  </code></pre>
  
  <p>THe socket does work. However, onProgressUpdate is not called, even though the background task tells me data came in. </p>
  
  <p>Anyone got some pointers for me?? I couldn't find anything on google :|</p>