Qt 5.4 QTcpSocket failure in WinRT with QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action



  • My code looks like this:
    @
    QTcpSocket->connectToHost(server, port, ReadWrite, IPv4Protocol);
    QTcpSocket->waitForConnected(30000);
    @

    The call to connectToHost, when running my project in debug mode on WinRT, has some debug output which looks fishy:
    HEAP[WinPCSQt.exe]: HEAP: Free Heap block 000000902D4DC260 modified at 000000902D4DC2C8 after it was freed
    qt.winrtrunner.app: QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action
    QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action
    qt.winrtrunner.app: QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action
    QNativeSocketEnginePrivate::nativeConnect:: Could not obtain connect action

    Running without the debugger, compiled with Release Profile, I get this message from winrtrunner on start: qt.winrtrunner.app: Unable to bind socket. (Access is denied.)

    When I call waitForConnected I get an immediate return of false. Two conditions:

    • Running without the debugger, but compiled with the Debug Profile: error() returns 0
    • Running WITH the debugger, compiled in Debug Profile: error() returns -1

    What I have tried:

    • I have verified that the connection works perfectly on all other OSes (even at the exact same time as trying on WinRT).
    • I have verified that it runs perfectly on the SAME MACHINE as a regular Windows desktop app
    • I have disabled the Windows firewall completely for all network types (public & private)
    • I have modified my deployment information for QMAKE with no luck (see below the winrt { config). This also doesn't actually generate any capabilities in the appxmanifest.xml.
    • I have modified the AppxManifest.xml directly and added capabilities for "internetClientServer" and "privateNetworkClientServer" (see below)
    • I have verified I'm modifying the correct AppxManifest.xml ... if I try to run the app from QtCreator with a malformed file, it complains that the file is invalid

    WinRT info on app manifest and capbilities:

    @
    winrt {
    winphone:equals(WINSDK_VER, 8.0) {
    WINRT_MANIFEST.capabilities += ID_CAP_NETWORKING
    } else {
    WINRT_MANIFEST.capabilities += internetClient
    }

    CONFIG += windeployqt
    

    }
    @

    @
    <Capabilities>
    <Capability Name="internetClientServer"></Capability>
    <Capability Name="privateNetworkClientServer"></Capability>
    </Capabilities>
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.