Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130590

Winsock being initialized with "DRAFT" version of 2.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9.0 FF
    • 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.6.0, 6.6.1, 6.6.2, 6.6.3, 6.7.0, 6.7.1, 6.7.2, 6.7.3, 6.8.0
    • Network: Sockets
    • None
    • Windows
    • f6ccbaa7a (dev)

    Description

      Not sure whether this makes any difference to the world in general, I just think it's a good idea to default to the latest version. (Specify version 2.2 when initializing Winsock.)

      • v2.0 was only an internal draft version.
      • v2.1 was the first public winsock 2 specification.
      • Nobody needs 16-bit OS support these days anymore?
      • v2.2 itself is ages old, and supported back to Windows 95 OSR2.

      https://en.wikipedia.org/wiki/Winsock#Specifications

      https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup

       

      https://github.com/qt/qtbase/blob/b839e9b36db3a4e50dfb34521d8ef8de1fd01969/src/corelib/global/qsysinfo.cpp#L135-L145

       

      ```

      QWindowsSockInit::QWindowsSockInit()
      :   version(0)
      {
          //### should we try for 2.2 on all platforms ??
          WSAData wsadata;

          // IPv6 requires Winsock v2.0 or better.
          if (WSAStartup(MAKEWORD(2, 0), &wsadata) != 0)

      {         qWarning("QTcpSocketAPI: WinSock v2.0 initialization failed.");     }

      else {
              version = 0x20;

      ```

       

      https://github.com/qt/qtbase/blob/b839e9b36db3a4e50dfb34521d8ef8de1fd01969/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp#L520

       

      ```

          QVERIFY(WSAStartup(MAKEWORD(2,0), &wsaData) == NO_ERROR);

      ```

       

      https://github.com/qt/qtbase/blob/b839e9b36db3a4e50dfb34521d8ef8de1fd01969/tests/manual/network_stresstest/tst_network_stresstest.cpp#L85

       

      ```

          // IPv6 requires Winsock v2.0 or better.
          WSAStartup(MAKEWORD(2,0), &wsadata);

      ```

       

      https://github.com/qt/qtbase/blob/b839e9b36db3a4e50dfb34521d8ef8de1fd01969/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp#L77-L78

       

      ```

          // IPv6 requires Winsock v2.0 or better.
          WSAStartup(MAKEWORD(2,0), &wsadata);

      ```

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            manordheim Mårten Nordheim
            qbx2k6 Stephen McCarthy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes