Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator loses internet connection after a period of time (inactive or active)

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

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.

like image 601
user1509803 Avatar asked Jan 10 '14 02:01

user1509803


1 Answers

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.

like image 154
user3361886 Avatar answered Oct 29 '22 13:10

user3361886