android - Socket.close() never returns causing TimeoutException on the OS -
I am using the HTTPClient library and I am getting a weird problem where Socket.close () calls never returned Returns a timeout exception that occurs once in a while and I can reproduce it about 10% of the time.
I am looking at this issue on Android 4.2, 4.3 and 4.4.
Here's a bug ticket I made for Android:
Any idea why socket.close will hang forever? How can I avoid this? Thanks!
02-17 20: 48: 31.800: E / Android Random (12871): Fatal Exceptions: Philalizer Watchdog Damon 02-17 20: 48: 31.800: E / Androindertime (12871): Process : Com.vblast.sample, PID: 12871 02-17 20: 48: 31.800: E / Android Random (12871): java.util.concurrent.TimeoutException: org.apache.http.impl.conn.PoolingHttpClientConnectionManager.finalize () Time-out after 10 seconds 02-17 20: 48: 31.800: E / Android time (12871): at libcore.io.Posix.close (Basic method) 02-17 20: 48: 31.800: E / Android time (12871) : On Libor Io.BlockGuardOs.close (BlockGuardOs.java:75) 02-17 20: 48: 31.800: E / Android Random (12871): libcore.io.OoBridge.closeSocket (IoBridge.java:188) 02-17 20:48 : 31.800: E / Android Random (12871): java.net.PlainSocketImpl.close (PlainSocketImpl.java:162) 02-17 20: 48: 31.800: E / Androindertime (12871): at java.net.Socket.close ( socket .java: 317) 02-17 20: 48: 31.800: e / Androidrentaim (12871): at org.apache.http.impl.BHttpConnectionBase.close (BHttpConnectionBase.java:346) 02- 17 20: 48: 31.800 e / AndroidRuntime (12871): 02-17 20: 48 on org.apache.http.impl.conn.LoggingManagedHttpClientConnection.close (LoggingManagedHttpClientConnection.java:83): 31.800: e / AndroidRuntime (12871): org.apache.http .impl.conn.CPoolEntry.closeConnection at (CPoolEntry.java:70) 02-17 20: 48: 31.800: E / AndroidRuntime (12871): o .close on rg.apache.http.impl.conn.CPoolEntry (CPoolEntry.java:96) 02-17 20: 48: 31.800: E / Android Rentaim (12871): at org.apache.http.pool.AbstractConnPool.shutdown (Abertkonpulkjawa 12) 02-17 20:48: 31.800: e / AndroidRuntime (12871): 48 :: 31.800: e / AndroidRuntime (12871): org.apache.http.impl.conn.PoolingHttpClientConnectionManager.shutdown (PoolingHttpClientConnectionManager. Java: 347) 02-17 in the organization on 20. apache.http.impl.conn.PoolingHttpClientConnectionManager.finalize (PoolingHttpClientConnectionManager.java:168) 02-17 20: 48: 31.800: E / AndroidRuntime (12871): java.lang.Daemons at $ FinalizerDaemon.doFinalize (Daemons.java:187 ) 02-17 20: 48: 31.800: e / Androiderun time (12871): 48 :: 31.800: e / AndroidRuntime (12871) at java.lang.Thread.run (Thread.java java.lang.Daemons $ FinalizerDaemon. run (Daemons.java:170) 02-17 at 20: 841)
I Socket.setSoLinger ()
comes hang thus as long as my connection timeout setting TimeoutException: /
what Socket.setSoLinger (it) < / Code> does:
If the socket connect In mode, and SO_LINGER option is non-zero is still set for the socket with the latest time, and socket untransmitted data, then passes (is) currently still refresh interval up to until all data The block will be broadcasted.
Comments
Post a Comment