Client cannot connect to server over the internet

0

I have two programs written by myself: server and client. Client uses server IP address to connect to it over the internet. After connection have been established, server must display message "Client connected". That's it. Server and client programs are run under Windows 7 on different computers. In order to make server program work properly I did some environment customizations:
1. Disabled firewall: Windows Firewall - Customize Settings - Turn off Windows Firewall (made settings like here)
2. I have static IP and router TPLink TL-WR841N. So I did port forwarding that way: router settings - Forwarding - Virtual Servers. In the opened menu I entered server local IP (e.g. 192.168.1.15) and port (37777). At this point online port checking services like this say that port 37777 is open.

Now i expect everything to work. But it doesn't: client program tries to establish connection, but fails, showing 'socket timeout error'. Programs like telnet cannot connect to the server too. If I run both server and client programs on server computer (one computer connects to itself) everything works fine (even if I use external IP address). If I run server program and then try port checking services, it shows that 'Client connected'.

How to configure both computers properly?

LPCWSTR

Posted 2017-11-30T18:30:19.647

Reputation: 1

1It's not clear to me why you did the port forwarding. If they are on the same net, you don't need anything special in the network setup. – Hack Saw – 2017-11-30T19:13:09.240

No, they are not in the same net. – LPCWSTR – 2017-11-30T19:22:02.337

You will probably need to provide a lot more detail. If your client program is aimed at the external IP address of the router at that port, and the it seems to be open, then things are weird. A trace route might help, in case something along to way is filtering out packets to that port number. Q.v. https://support.microsoft.com/en-us/help/314868/how-to-use-tracert-to-troubleshoot-tcp-ip-problems-in-windows

– Hack Saw – 2017-11-30T19:33:34.103

It can't trace route from client computer due to 'Request timed out', but if I enable proxy - most of the time it can trace route. The same story with ping: sometimes it writes ok, sometimes - destination is unreachable. Seems that this is the problem, but I don't know how to solve it. – LPCWSTR – 2017-12-01T09:55:40.653

No answers