TCP Windows Service Listener
Hi,
I have a problem with a window service that should be listen to TCP connection on some port.
It is OK if the client connect to localhost host by name or by ip 127.0.0.1, but it can't connect to it by its true IP from network or from the same machine. The problem persist in telneting on that port the machine : it works only to 127.0.0.1
I used winsockets.
Re: TCP Windows Service Listener
The 'true' IP as you called it is the IP of the router, what you need to do is go into the router settings and look for 'Port Forwarding' you then need to configure it to forward whatever port your app uses, to the local IP of the machine that is running the listener program.
When you try to connect to the 'true' IP, or external Internet IP, the router receives the connection attempt, but if PF is not configured, the router does not know which host on the network to pass the connection to, so it will just drop it. That is why you can't connect to the external IP.
Re: TCP Windows Service Listener
Also, if you setup the listener to listen to localhost, it will only resolve to 127.0.0.1. Try making the listener listen on 0.0.0.0 which should listen on all available interfaces simultaneously.