Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QTcpServer listen() problem
QtWS25 Last Chance

QTcpServer listen() problem

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 3.0k 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
    grumpy
    wrote on last edited by
    #1

    I have a problem with NokiaQtSDK which has QT 4.63. The test device is Nokia E7.
    The QTcpServer listen() doesn't really seem to work as expected.

    I start my Network connections manually before starting the app.
    So QNetworkInterface::allAddresses() returns two IP addresses:

    "192.168.0.221" (WLAN)
    "213.132.1.226" (AP)

    Then I start to listen:

    @
    QTcpServer serv1, serv2;
    serv1.listen(QHostAddress("192.168.0.221"), 80); //WLAN return true
    serv2.listen(QHostAddress("213.132.1.226"), 80); //AP return true
    serv1.isListening(); //WLAN return true
    serv2.isListening(); //AP return true
    @

    However only one is truely listening. This seems to depend on which of theese two comes first in the:

    Connectivity->Settings->Network Destinations->Internet list.

    When I set WLAN first WLAN listens, when I set AP first AP listens. Tested both with web browser to see if port is open and with "nmap -sT" which always reports one port listening and the other being closed.

    I get the same result if I only do listen(QHostAddress::Any);

    Any way I can fix this?

    Grumpy

    EDIT: please use @-tags to enable code highighting, Gerolf

    thanks, didn't know this!

    1 Reply Last reply
    0

    • Login

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