Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6869

QTcpServer (FortuneServer) Example not working on Windows 7

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 4.6.0
    • Network
    • None
    • Windows 7, Qt 4.6.0

    Description

      The QTcpServer Fortune Server example isnt working on Windows 7. It doesnt bind itself to a valid port.

      in server.cpp

      tcpServer = new QTcpServer(this);
          if (!tcpServer->listen()) {
              QMessageBox::critical(.....);
              close();
              return;
          }
          statusLabel->setText(tr("The server is running on port %1.\n"
                                  "Run the Fortune Client example now.")
                               .arg(tcpServer->serverPort()));
      

      tcpServer->serverPort() returns 0, which means the server isnt listening for conenctions.
      tcpServer->listen() is called without a port parameter. So it should choose a port automatically which it doesnt. The call however returns true

      Under Windows XP the example works fine, starts up and automatically chooses a port.

      Other Examples using QTcpServer in the same way, without specifying a port explicitly, are failing too.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mgoetz Markus Goetz (Inactive)
              cypher a
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes