Connect android device to server in emulator Background

I've been search AE, SO and Google for many hours and found many examples of people wanting to connect their PC to the emulator. I've also run across some that wish to connect their device to their server on a PC. I want to connect my device, to an emulator running on a PC. I've tried the examples given in the documentation but I still haven't gotten this to work.

I would like to have my device (real device, Nexus 7) create a Hotspot that my PC is connected to. In the PC, an emulator is running that has a socket open on port 40000. I'm getting ECONNREFUSED errors when trying to connect my device to the emulator. Here's what I'm doing:

Connecting device to emulator (through PC)

Device tries to create a Socket connection to the emulator through the PC. The IP of my PC is 192.168.43.198 so that is what the device use as destination IP. The connection fails however, with an ECONNREFUSED message.

Forwarding using ADB and telnet

On the PC I've tried to forward port 40000 to the emulator using:

adb forward tcp:40000 tcp:40000 

and 

redir add tcp:40000:40000 

over telnet to the emulator. 

When running the adb forward command I get a listening port on the PC as such: 

TCP    127.0.0.1:40000        0.0.0.0:0              LISTENING. 

Notice that the listening IP is 127.0.0.1.

When running the redir command, I can see no listening port using netstat.

Testing connection from device to PC

To test the connection "parts", I've used SocketTest (http://sourceforge.net/projects/sockettest/) on my PC. 

If I use it as a server, listening on port 40000. Then my device connects to it just fine using 192.168.43.198:40000.

Testing connection from PC to emulator

When using SocketTest as a client to connect to 127.0.0.1:40000 it also connects fine to the emulator. 

However, when using the external IP: 192.168.43.198, SocketTest also gets connection refused!

Possible problems

It seems to me that my PC doesn't realise it should route 192.168.43.198:40000 to 127.0.0.1:40000 although the commands I've entered claim to do so in the docs (http://developer.android.com/tools/devices/emulator.html#redirection and http://developer.android.com/tools/help/adb.html#forwardports)

Firewall is turned off.
The problem here is that ADB forwarding attaches itself to the local loopback interface (127.0.0.1), and you have no forwarding from the LAN interface (192.168.43.198) to the loopback interface. The method you can use to achieve this depends on your platform. I don't know what you could use in Windows, but on Linux you can use rinetd and on OSX you can use ipfw

LINUX:

Add the following lines to your /etc/rinetd.conf:    

# bindaddress    bindport  connectaddress  connectport
192.168.43.198   40000     127.0.0.1       40000


Then restart rinetd with service rinetd restart or /etc/init.d/rinetd restart.

OSX:

ipfw add fwd 127.0.0.1,40000 tcp from any to 192.168.43.198 dst-port 40000