0

I am running my android emulator on my machine. I have a virtual machine running that is on a host-only network with. The address of the interface is 192.168.56.1 and my VM is 192.168.56.2, I want to make a socket connection from my emulator to a java program running on the virtual machine. I have googled around but can't find a concrete answer. Do I need to do some sort of forwarding so my emulator can see the interface. I can create a connection between my host and VM by doing the following

    Socket s = new Socket();
    s.bind(new InetSocketAddress("192.168.56.1",9090);
    s.connect(new InetSocketAddress("192.168.56.2",9090);

This will create a socket connection, but what do I have to do to create a socket connection from Emulator to VM?

sideshowbob
  • 204
  • 6
  • 22
  • Check if something useful here http://stackoverflow.com/questions/21207664/unable-to-create-android-client-socket/21207700#21207700 – mario ruiz Feb 19 '14 at 15:45
  • But it appears that 10.0.2.2 won't see the interfaces on my machine. There for it won't see my interface with 192.168.56.1 and can't connect to the VM which is at 192.168.56.2 – sideshowbob Feb 19 '14 at 16:05

0 Answers0