[Tiny-Tut] - Communicating between two emulators
,:warning: (could not get this to work
) 
) 
first of all, if you want to run a server/service within an emulated system, you must
setup a network redirection (either through "[font=Courier New]adb forward[/font]" or the console's "[font=Courier New]redir add[/font]" commands). consider the following console example:
- Code: Select all
redir add tcp:5000:7000
this setups a TCP redirection from your host's [font=Courier New]localhost:5000[/font] to the emulated system's [font=Courier New]localhost:7000[/font]
you can then run a server in the emulated system on emulated [font=Courier New]localhost:7000[/font], and outside clients will be able to access it through host [font=Courier New]localhost:5000[/font]
now, if you start a second emulator and wants it to connect to the service running on the first one. All you need to do is use the [font=Courier New]10.0.2.2[/font] address, which serves as an alias to your host localhost, so connect the client to [font=Courier New]10.0.2.2:5000[/font] and you will be all set.
note: yes, it's more a documentation bug than anything else. the [font=Courier New]10.0.2.2[/font] alias is a feature inherited from QEMU, which isn't even largely documented.
Regards,
plusminus




