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. QNetworkSession::Invalid & different IP settings

QNetworkSession::Invalid & different IP settings

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.5k Views 1 Watching
  • 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.
  • V Offline
    V Offline
    Vater Frost
    wrote on last edited by
    #1

    Hi there,

    I'm standing in front of a problem not easy to solve for me as I am not a system admin. My client server application runs perfectly on a system with pure IPv4 configuration. Even my Win7 PC with IPv6 and IPv4 addresses is able to listen correctly on IPv4 - using tcp_server->listen(QHostAddress::Any,2000). The Qt-Doc says, QHostAddress::Any is listening on all IPv4 addresses. Now, I have a special Win7 PC, where I am not able to listen on IPv4 - however it is visible in the Windows network and all windows programms seem not to have communication problems. I always run into QNetworkSession::Invalid. The ipconfig /all looks similar to the Win7 PC and IPv6 config where it runs without errors (at least similar for me). Is there something I need to check in addition? Is there a thing I have to take into account in my code? Any clues or hints would be very much appreciated.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fluca1978
      wrote on last edited by
      #2

      Could it be the firewalling of the windows machine? Even if your application should be able to always listen on an unprivileged port, I guess it has something to do with the firewall. Exluding the trivial case you are listening on the same port another program is using too.
      However, as a quick trial, try disabling the firewall at all and see if the situation goes better.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vater Frost
        wrote on last edited by
        #3

        Ok, I will give the Firewall a try.

        For my understanding: Is it mandatory in internal networks to announce a proper port? The port 2000 is not really used, when I check it after a valid connection. I always thought that ports are just needed for communication over the internet (outside a domain name area).

        Thanks.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fluca1978
          wrote on last edited by
          #4

          It's no required to advice the ports you are using, but it is a good idea to check which ports are already used by some well known services (e.g., /etc/services). And of course, using ports greater than 1024 is another good idea.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            Vater Frost
            wrote on last edited by
            #5

            We found the error. It is because of strange user settings. When launched as Admin the software is able to aquire network access. So it was not because of Firewall and IPv4/IPv6. However the error is not solved, but root cause seems to be in Windows settings and not in QtNetwork.

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fluca1978
              wrote on last edited by
              #6

              Great! So the problem is that the security center of windows believes your application could be malicious and prevents it to open a port.So you have to remember that the application has to be launched with the admin settings.

              1 Reply Last reply
              0
              • V Offline
                V Offline
                Vater Frost
                wrote on last edited by
                #7

                Wow, I did not know I'm a virus developer...

                Do you think there is a way to bypass this check from software side with Qt methods? I currently have the feeling I need to sign my software. But really, I would like to avoid this, as it is not cross platform.

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fluca1978
                  wrote on last edited by
                  #8

                  I don't know, since I'm not a windows developer.
                  However, I suspect this is a feature you cannot easily bypass, since it is something within the hosting operating system. Probably adding exception to the trusted programs could work.

                  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