I am trying to send a string from the windows to the linux vmware on the same machine.
I did the following:
- opened a socket on 127.0.0.1 port 50000 on the linux machine and reading the socket in a while loop. My programming language is python 2.7
- send a command using nc ( netcat ) on 127.0.0.1 port 50000 from the windows machine ( using cygwin ).
However, I dont receive any command on the linux machine although the command sent through windows /cygwin is successful.
I am using NAT ( sharing the hosts IP address ) on the VMWARE Machine.
Where could be the problem?
When you use NAT, the host machine has no way to directly contact the client machine. All you can do is usign port forwarding to tell vmware that all traffic directed to the designated ports on the host is to be delivered to the client. It is intended to install a server on the client machine that can be accessed from  outside the host machine.
If you want to test network operation between the host and the client, you should configure a host-only adapter on the client machine. It is a virtual network between the host and the client(s) machine(s) (more than one client can share same host-only network, of course with different addresses)
I generally configure 2 network adapters on my client machines :

one NAT to give the client machine an access to the open world
on host-only to have a private network between host and clients and allow them to communicate with any protocol on any port

You can also use a bridged interface on the client. In this mode, the client machine has an address on same network than the external network of the host : it combines both previous modes
Send a string from windows to vmware-ubuntu over socket using python