connecting emulators

天大地大妈咪最大 提交于 2019-12-08 04:42:48

问题


I'm trying to create an application in adroid that connects to emulators both of them running on the same machine.And after asking a few questions in here and reading http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking I have a slightly idea of how to do it,at least that's how I fell,but still need some extra explanations.

How is on dev's guide

A is the machine

B the first emulator working as a server

C the second emulator which is considered the client

Each emulator works behind a virtual router and has the address 10.0.2.15.Now,none of this emulators see each other or the servicies on the host machine.

So,in order for the client to break and get to A it has to use the loopack address.By connecting to 10.0.2.2 at the port 5554(where 5554 is the port assignated to the emulator and is next to its name,like avd 5554).

Now,my power of understanding stops here,because I dn't get why should I put the server B listening on 10.0.2.15 to 5555(I get 5555 the port of the second emulator,the way I got them when I ran the second avd).... Please could someone light me,cause I've turned this site upside down and still can't figure.

And one last thing:What is the trick with redirecting from A to B?What's it purpouse? I really wanna understand this, so please give a understandable explanation:)

P.S:Hope I've done well editing my old comment and no one will get mad!

来源:https://stackoverflow.com/questions/5584944/connecting-emulators

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!