Reputation: 48615
So I have an android application that needs to connect to a socket server. That's simple enough if the socket server was running on my development machine. However the socket server is running on a server not only not on my own machine, but on a different subnet. How would I connect my emulator to the socket server? I understand how the port forwarding works to connect to the local machine, but I'm sort of confused on how I can redirect it across a subnet from my dev machine.
Upvotes: 3
Views: 3884
Reputation: 25281
Can you get to the socket server from the host machine of the emulator? I don't know about you, but I've been testing a networked client app on the Android emulator, and it seems to be able to access anything on the network that my development box can with just the standard Java networking calls and no special setup emulator-side. This includes the wider Internet.
If you can't, you need to set up the server side to make sure the server is exposed to remote machines; this has nothing to do with what you're doing on the Android emulator side unless the server is also an Android emulator. It may have to do with firewall rules and standard network routing of course.
Upvotes: 1