亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

在程序代碼中對wifi網絡發生變化情況進行處理

發布時間:2020-08-05 12:52:06 來源:網絡 閱讀:352 作者:truesea 欄目:開發技術

當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


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

秦安县| 邵武市| 望江县| 中江县| 阳西县| 乡宁县| 都江堰市| 确山县| 滦平县| 县级市| 绵阳市| 深水埗区| 潢川县| 齐河县| 高雄县| 商河县| 安阳县| 惠东县| 陆川县| 天水市| 垣曲县| 冀州市| 黎川县| 舒兰市| 麻江县| 崇阳县| 房山区| 宜兰县| 新泰市| 涟水县| 延长县| 徐汇区| 安西县| 万荣县| 孟津县| 吴旗县| 壶关县| 郯城县| 天全县| 唐山市| 平原县|