Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterruptedIOException in Android L #81

Closed
RiLakNamKuMa opened this issue Nov 7, 2014 · 2 comments
Closed

InterruptedIOException in Android L #81

RiLakNamKuMa opened this issue Nov 7, 2014 · 2 comments

Comments

@RiLakNamKuMa
Copy link

I have a problem with using okio lib on Android L OS.

I confirmed that HTTP header is created ordinarily before sending "HTTP GET" msg to server.

System.out: (HTTPLog)-Thread-1838-670551125: http socket connected to aaa.com/193.155.127.100:80 from /10.71.109.31:60059 with reading time out 0
System.out: (HTTPLog)-Thread-1838-670551125: connect() done, current connection is com.android.okhttp.Connection@3c35d8d1
System.out: (HTTPLog)-Thread-1838-670551125: transport is com.android.okhttp.internal.http.HttpTransport@da32f36
System.out: (HTTPLog)-Thread-1838-670551125: writeRequestHeaders GET /13i92/latest.txt HTTP/1.1

But, next step is fail. It's crashing with exception:

com.android.okio.Deadline.throwIfReached(Deadline.java:56)

System.err: java.io.InterruptedIOException
System.err: at com.android.okio.Deadline.throwIfReached(Deadline.java:56)
System.err: at com.android.okio.Okio$1.write(Okio.java:70)
System.err: at com.android.okio.RealBufferedSink.flush(RealBufferedSink.java:154)
System.err: at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:126)
System.err: at com.android.okhttp.internal.http.HttpTransport.flushRequest(HttpTransport.java:80)
System.err: at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:775)
System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:379)
System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:323)
System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:190)
System.err: at java.net.URL.openStream(URL.java:470)

@dhpiggott
Copy link

I note in the first line that your code has printed with reading time out 0. Would I be correct in interpreting this to mean that you've passed a desired read timeout of 0 into OkHttp? If so, maybe that is the cause?

@swankjesse
Copy link
Member

The thread performing IO has been interrupted. You can prevent this by not calling Thread.interrupt(). Or by clearing the interrupted status by calling Thread.interrupted() before you call openStream().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants