一段时间(无效或活动)后,Android模拟器会失去互联网连接 [英] Android emulator loses internet connection after a period of time (inactive or active)

查看:36
本文介绍了一段时间(无效或活动)后,Android模拟器会失去互联网连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道很多人在我之前就问过这个问题,但是我找不到任何答案,因此必须在此处重新张贴.

I know that many people asked this before I do, but I can't find any answer so got to repost it here.

因此,当我启动android模拟器时,一切都很好.但是过了一会儿,例如5分钟,它将失去互联网连接,这意味着我无法通过浏览器或我的应用程序访问互联网.我唯一能做的就是通过关闭模拟器来重新启动模拟器,然后重新启动.

So when I start the android emulator, everything is fine. But after a while, like 5 minutes, then it'll lose the internet connection, which means I can't access to the internet via browser, or my app. The only thing I can do is to restart the emulator by close it and start it again.

任何回应,我们都感激不尽.

Any response is appreciated.

推荐答案

这是由于仿真器代码中的错误所致.基本上,它不会关闭UDP套接字,从而导致套接字泄漏".如果您在主机(Winows)上监视emulator-x86.exe进程的套接字连接,则您会注意到,例如在浏览器上访问新站点时,连接数量一直在增加.当计数超过一个点(大约100)时,仿真器将无法打开新的网络连接.我有同样的问题,到目前为止没有找到任何解决方案.

This is due to a bug in the emulator code. Basically it doesn't close UDP sockets which in turn causes "socket leak". If you monitor socket connections for the emulator-x86.exe process on your host (Winows), you will notice that the number of connections keep going up as you visit new sites on a browser for example. When the count goes beyond a point (around 100), the emulator fails to open new network connections. I have the same issue and did not find any solution so far.

这篇关于一段时间(无效或活动)后,Android模拟器会失去互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆