Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Cannot connect to localhost from QTcpSocket to QTcpServer
QtWS25 Last Chance

[SOLVED] Cannot connect to localhost from QTcpSocket to QTcpServer

Scheduled Pinned Locked Moved General and Desktop
networkqtcpsocketqtcpserver
2 Posts 1 Posters 3.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Giorgi
    wrote on 25 Apr 2015, 20:17 last edited by Giorgi 5 Apr 2015, 17:49
    #1

    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?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Giorgi
      wrote on 26 Apr 2015, 20:38 last edited by Giorgi 5 Jan 2015, 12:41
      #2

      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 localhost

      so you need to fix it manually.

      1 Reply Last reply
      0

      1/2

      25 Apr 2015, 20:17

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved