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. QTcpSocket and error
Qt 6.11 is out! See what's new in the release blog

QTcpSocket and error

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 3.7k Views 3 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #2

    Hi! Are your firewalls shut down? MAC (SELinux, AppArmor, Tomoyo) disabled?

    1 Reply Last reply
    2
    • FranckynosF Offline
      FranckynosF Offline
      Franckynos
      wrote on last edited by Franckynos
      #3

      It's not a problème with firewall because it works in first case.
      If I have used ip 192.168.0.x in first case for the server it works.
      And if i swith the client and server on pc with the same address 192.168.0.x it doesn't work.

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Hi
        How do you assign these ips?

        If you are on a network with dhcp you can't use what ever
        ip you want for static.

        The correct way is to lower the range for automatically assigned ips on the dhcp router and
        then use one of none shared ips for static.
        Some routers can also do it based mac addresses.

        1 Reply Last reply
        0
        • FranckynosF Offline
          FranckynosF Offline
          Franckynos
          wrote on last edited by
          #5

          Hi
          Thanks for your reply.

          There isn't dhcp because I have no router it's ad hoc network created under windows with cmd:

          Netsh wlan start hostednetwork.

          And I assign ip address with a command like that:
          Netsh interface ip set address name="Wi-Fi" static 192.168.0.10 255.255.255.0.

          mrjjM 1 Reply Last reply
          0
          • FranckynosF Franckynos

            Hi
            Thanks for your reply.

            There isn't dhcp because I have no router it's ad hoc network created under windows with cmd:

            Netsh wlan start hostednetwork.

            And I assign ip address with a command like that:
            Netsh interface ip set address name="Wi-Fi" static 192.168.0.10 255.255.255.0.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @Franckynos

            Ok it sounds like you know networking pretty well then.
            So if its ad hoc, it seems unlikely that the ip be in use.
            I have no further ideas it it seems u done ping test etc.

            Give it some days and see if others have better ideas.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              Hi,

              What port are you using ? Do you have anything else that might use it ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • FranckynosF Offline
                FranckynosF Offline
                Franckynos
                wrote on last edited by
                #8

                The port used is 5555 but the comminucation works well.

                PC A (Server) => 192.168.0.10
                PC B (Client) => 192.168.0.20

                OK

                but if i swith server and client.
                PC B (Server) => 192.168.0.10
                PC A (Client) => 192.168.0.20

                The connection can be established.

                If i change the ip of server in this configuration
                PC B (Server) => 192.168.0.11
                PC A (Client) => 192.168.0.20

                it'll work ? But i don't know why.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  Than a silly question, did you check that the port is not still opened ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • FranckynosF Offline
                    FranckynosF Offline
                    Franckynos
                    wrote on last edited by
                    #10

                    How can i do that ? with listening ?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      netstat would likely be more appropriate

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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