title: Android Volley NoConnectionError: java.io.InterruptedIOException
body: <p>I have below code to make request to web service using volley:</p>
  
  <pre><code>RequestQueue requestQueue =  Volley.newRequestQueue(getActivity(),new OkHttpStack());
  GsonRequest&lt;myData&gt; request = new GsonRequest&lt;myData&gt;(Method.POST,Config.MYPOSTLINK, myData.class, getSuccessListener, getErrorListener);
  request.setParams("Token", token);        
  requestQueue.add(request);
  </code></pre>
  
  <p>I have implemented OkHttpStack.java as <a href="https://gist.github.com/JakeWharton/5616899" rel="nofollow">like this</a>:</p>
  
  <pre><code>public class OkHttpStack extends HurlStack {
      private final OkHttpClient client;
  
      public OkHttpStack() {
          this(new OkHttpClient());
      }
  
      public OkHttpStack(OkHttpClient client) {
          if (client == null) {
              throw new NullPointerException("Client must not be null.");
          }
          this.client = client;
      }
  
      @Override protected HttpURLConnection createConnection(URL url) throws IOException {
          return new OkUrlFactory(client).open(url);
      }
  }
  </code></pre>
  
  <p>Sometimes i get error below:</p>
  
  <pre><code>00.482    com.ex W/System.err﹕ com.android.volley.NoConnectionError: java.io.InterruptedIOException: thread interrupted
  00.483    com.ex W/System.err﹕ at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
  00.483    com.ex W/System.err﹕ at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
  00.483    com.ex W/System.err﹕ Caused by: java.io.InterruptedIOException: thread interrupted
  00.483    com.ex W/System.err﹕ at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.okio.Okio$1.write(Okio.java:73)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:902)
  00.483    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:788)
  00.484    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:439)
  00.484    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
  00.484    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
  00.484    com.ex W/System.err﹕ at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
  00.484    com.ex W/System.err﹕ at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96)
  00.484    com.ex W/System.err﹕ ... 1 more
  00.589    com.ex W/System.err﹕ com.android.volley.NoConnectionError: java.io.InterruptedIOException: thread interrupted
  00.589    com.ex W/System.err﹕ at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:151)
  00.589    com.ex W/System.err﹕ at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)
  00.589    com.ex W/System.err﹕ Caused by: java.io.InterruptedIOException: thread interrupted
  00.589    com.ex W/System.err﹕ at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.okio.Okio$1.write(Okio.java:73)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:902)
  00.589    com.ex W/System.err﹕ at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:788)
  00.590    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:439)
  00.590    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
  00.590    com.ex W/System.err﹕ at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
  00.590    com.ex W/System.err﹕ at com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:109)
  00.590    com.ex W/System.err﹕ at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:96)
  00.590    com.ex W/System.err﹕ ... 1 more
  </code></pre>
  
  <p>How to overcome ? Any way to rerequest if i get this error ?</p>