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. QUdpSocket bind problem
Forum Updated to NodeBB v4.3 + New Features

QUdpSocket bind problem

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 5 Posters 4.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.
  • J JulsPower

    WSAGetLastError return error 10106 (WSAEPROVIDERFAILEDINIT)
    gives you an idea??

    HansonH Offline
    HansonH Offline
    Hanson
    wrote on last edited by
    #21

    @JulsPower
    Can you show me where in your code calling WSAGetLastError()?

    J 1 Reply Last reply
    0
    • HansonH Hanson

      @JulsPower
      Can you show me where in your code calling WSAGetLastError()?

      J Offline
      J Offline
      JulsPower
      wrote on last edited by
      #22

      @Hanson said in QUdpSocket bind problem:

      @JulsPower
      Can you show me where in your code calling WSAGetLastError()?

      b = m_UdpSocket->bind(QHostAddress::Any, 55555);
      auto state = m_UdpSocket->state();
      QMessageBox::information(this, "info", QString(b?"true ":"false ") + QString::number(state) + QString::number(WSAGetLastError()));
      

      show while debugging it shows false 010106

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulsPower
        wrote on last edited by JulsPower
        #23

        I replicated the samething in a new project using qmake instead of cmake. lo and behold it works in debugging mode...
        seem ill be using qmake

        HansonH 1 Reply Last reply
        0
        • J JulsPower

          I replicated the samething in a new project using qmake instead of cmake. lo and behold it works in debugging mode...
          seem ill be using qmake

          HansonH Offline
          HansonH Offline
          Hanson
          wrote on last edited by Hanson
          #24

          @JulsPower
          Maybe same as this question
          https://stackoverflow.com/questions/48597996/qtcpserver-return-unknown-error-on-listen-function-only-under-debugger
          https://developercommunity.visualstudio.com/t/native-cmake-support-application-debug-launch-is-b/562174

          So the reason could be that when debugging the program with cmake project, the environment variables were cleared and the SystemRoot variable was missing, which caused WSASocket to fail to load the related components.

          1 Reply Last reply
          1
          • HansonH Offline
            HansonH Offline
            Hanson
            wrote on last edited by
            #25
            This post is deleted!
            1 Reply Last reply
            0
            • J Offline
              J Offline
              JulsPower
              wrote on last edited by
              #26

              seems like it
              thank you

              1 Reply Last reply
              0
              • J JulsPower has marked this topic as solved on
              • Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by Kent-Dorfman
                #27

                @JulsPower I understand you probably lack the motivation and time to do it, but it would be interesting to see the differences in the build between cmake generated makefile an qmake generated makfile. Obviously the two are building/linking differently. Smells like a build flag isn't the same in cmake debug

                I light my way forward with the fires of all the bridges I've burned behind me.

                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