您好,登錄后才能下訂單哦!
當wifi功能被關閉時,在Log中看到以下和wifi狀態改變有關的日志:
11-04 11:09:34.559: E/WifiService(185): Handle MESSAGE_DISABLE_WIFI. 11-04 11:09:34.569: D/DATA(287): [DCT(0) ] intent received :android.net.wifi.WIFI_STATE_CHANGED 11-04 11:09:34.569: D/StatusBarPolicy(254): updateWifi: android.net.wifi.WIFI_STATE_CHANGED : wifi state: 0 supplicant connected: false 11-04 11:09:34.579: I/wpa_supplicant(8310): CTRL-EVENT-TERMINATING - signal 15 received 11-04 11:09:34.579: V/WifiMonitor(185): Event [CTRL-EVENT-TERMINATING - signal 15 received] 11-04 11:09:34.579: V/WifiStateTracker(185): handleMessage(): msg.what= 2
在當前程序中沒有對wifi斷開進行處理,所以出現以下異常:
11-04 11:09:35.889: E/DownThread(7389): Connection timed out 11-04 11:09:35.889: E/DownThread(7389): java.net.SocketException: Connection timed out 11-04 11:09:35.889: E/DownThread(7389): at org.apache.harmony.luni.platform.OSNetworkSystem.read(Native Method) 11-04 11:09:35.889: E/DownThread(7389): at dalvik.system.BlockGuard$WrappedNetworkSystem.read(BlockGuard.java:273) 11-04 11:09:35.889: E/DownThread(7389): at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:458) 11-04 11:09:35.889: E/DownThread(7389): at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:85) 11-04 11:09:35.889: E/DownThread(7389): at java.io.BufferedInputStream.read(BufferedInputStream.java:319) 11-04 11:09:35.889: E/DownThread(7389): at org.apache.harmony.luni.internal.net.www.protocol.http.FixedLengthInputStream.read(FixedLengthInputStream.java:44) 11-04 11:09:35.889: E/DownThread(7389): at java.io.BufferedInputStream.read(BufferedInputStream.java:319) 11-04 11:09:35.889: E/DownThread(7389): at java.io.FilterInputStream.read(FilterInputStream.java:133) 11-04 11:09:35.889: E/DownThread(7389): at com.tvie.ivideo.download.logic.DownThread.run(DownThread.java:65)
出現異常的代碼是InputStream的read方法。
while ((len = is.read(buffer)) != -1 && running) {
read方法的聲明表現會拋出IOException。
int java.io.InputStream.read(byte[] buffer) throws IOException
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。