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

Make the Windows socket handle non-inheritable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.0.0
    • 4.0.0, 4.0.1, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.3.5, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0
    • Network: Sockets
    • None

      When using spawned processes, sockets opened by the client remain in CLOSE_WAIT state after closing the connection. Sockets on the remote side would be in FIN_WAIT_2 state and waiting for ACK.
      When the spawned (child) process is closed, then ACK is sent and sockets are finally moved to CLOSE state on both sides.
      This seems to be caused by the default handle inheritance on Windows by child processes.

      On Unix it works correctly because we use FD_CLOEXEC, but on Windows it is not handled. We need to use DuplicateHandle with bInheritable = false.

      See the article: http://support.microsoft.com/kb/150523/en-us/

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

            shkearns Shane Kearns
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes