Interrupt an Http Request blocked in read() on Android
- by twk
Using the Apache Http stack on Android, I'm trying to force a thread out of a call to read. This is what the stack looks like:
OSNetworkSystem.receiveStreamImpl(FileDescriptor, byte[], int, int, int) line: not available [native method]
OSNetworkSystem.receiveStream(FileDescriptor, byte[], int, int, int) line: 478
PlainSocketImpl.read(byte[], int, int) line: 565
SocketInputStream.read(byte[], int, int) line: 87
SocketInputBuffer(AbstractSessionInputBuffer).fillBuffer() line: 103
SocketInputBuffer(AbstractSessionInputBuffer).read(byte[], int, int) line: 134
IdentityInputStream.read(byte[], int, int) line: 86
EofSensorInputStream.read(byte[], int, int) line: 159
Fetcher.readStream() line: 89
I've tried InputStream.close(), Thread.Interrupt(), and HttpUriRequest.abort(), without any success. Any ideas? I'm also open to some kind of non-blocking IO, but I don't see any way to do that with the HttpUriRequest object.
Thanks!