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. Low Speed QTCPSocket on Win7
Forum Updated to NodeBB v4.3 + New Features

Low Speed QTCPSocket on Win7

Scheduled Pinned Locked Moved General and Desktop
13 Posts 4 Posters 7.2k 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.
  • M Offline
    M Offline
    mohsen
    wrote on last edited by
    #1

    I've created a threaded server application using QTCPServer. It response great and quick on Linux but very slow on Win7. I disabled my network device driver but still same result.
    Where's the problem or any config?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      No idea without seeing some more information and preferably a small compilable example that reproduces the problem.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mohsen
        wrote on last edited by
        #3

        even i tested the simplest tcp application. it`s slow too.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          How did you test it? How do you define slow? High latency? Low bandwidth? Long connection setup/tear-down? Under what conditions? Where was the remote end? Did you rely on DNS and is your DNS server responsive? Any firewalls, proxying, or filtering going on?

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mohsen
            wrote on last edited by
            #5

            I disabled all controllers such as firewalls, network monitors, antivirus. I tried my app on virtual machine that runs WinXP. VM uses same network settings on host OS. It's ok there. this means that there's no problem in device driver, connection or dns or dhcp settings or anything. right?
            It's very slow on establishing connection from client to server only on Win7.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mohsen
              wrote on last edited by
              #6

              Finally i fixed the problem.
              Report:
              The problem is where i use both applications (Client and Server) on single pc. So i have to set local IP Address ("127.0.0.1") instead of "localhost" on QTCPSocket HostName property. using "localhost" takes time to find the local IP address.

              Thanks Zap.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #7

                Ah. Glad you got it sorted. Now I wonder why Win7 takes so long to resolve "localhost"?

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mohsen
                  wrote on last edited by
                  #8

                  when using "localhost" windows sends a DNS request to domain suffix search list to discover proxy servers via Auto Discovery Protocol. So it takes a time to get response. but 127.0.0.1 is defined as local IP address and it doesn't need to lookup.

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #9

                    Ah OK. Does Win7 not have localhost mapped to 127.0.0.1 in etc/hosts anymore then? DNS admins could have fun pointing localhost at something else then ;-)

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mohsen
                      wrote on last edited by
                      #10

                      it does, but seems a fake!

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        ZapB
                        wrote on last edited by
                        #11

                        Very strange. I'm sure MS have their reasons even if they are not clear to the rest of us mere mortals :-) At least you resolved your particular issue.

                        Nokia Certified Qt Specialist
                        Interested in hearing about Qt related work

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SteveFlores
                          wrote on last edited by
                          #12

                          what's the bit of your OS? 32 or 64 bit? one of my friends is having the same problem. His OS is Win7 32-bit OS.

                          <a target="_new" href="http://www.unknowndevicedrivers.com/">Fix Unknown Device</a>

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

                            [quote author="Mohsen" date="1320060819"]when using "localhost" windows sends a DNS request to domain suffix search list to discover proxy servers via Auto Discovery Protocol. [/quote]

                            This problem seems to be related on how Microsoft handles IPv4 and IPv6, If I get it right, this strange behavior is implemented in order to ensure that if you disable IPv4 and do a DNS query for another IPv4 address you don't get such query going thru the loopback interface (that is tied to an IPv4 address: 127.0.0.1).
                            Beside this, I consider doing a DNS lookup for localhost a stupid thing, and a sure way for an attack to come. Any other comments could sound a little rude...

                            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