[SOLVED] Cannot connect to localhost from QTcpSocket to QTcpServer
-
wrote on 25 Apr 2015, 20:17 last edited by Giorgi 5 Apr 2015, 17:49
Hi everyone.
I have strange issue. I wrote network applications. one server and one client. it worked fine until today. but today I have a problem. server started and QTcpServer::listen method returns true(so it listening to host localhost:1234). but from my client and telnet I can't connect to localhost:1234.
Why? any ideas?
-
wrote on 26 Apr 2015, 20:38 last edited by Giorgi 5 Jan 2015, 12:41
OK. Solution was so simple. I am on windows and there is file named hosts on the path C:\Windows\System32\drivers\etc. just edit this file and add this line:
127.0.0.1 localhost
Sometimes some application during the installation edits this file and replaces
127.0.0.1 localhost
with 0.0.0.0 localhostso you need to fix it manually.
1/2