diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-08-22 10:13:15 +0300 |
---|---|---|
committer | Andrew Knight <andrew.knight@digia.com> | 2014-08-28 05:58:43 +0200 |
commit | dd305aee786a03455b6f86b3d342fc30673a0fd4 (patch) | |
tree | 04109e1184c65e842363e56cc251191316c9ce59 /src/network/socket/qnativesocketengine_winrt_p.h | |
parent | 6d57f3f27e8d57b28c0788e55cfed26161ae2aca (diff) |
winrt: Fix socket descriptor storage in native socket engine
This stores the socket pointer in the descriptor, rather than an
abitrary handle, so that it is easier to access from e.g. SSL socket.
To further support SSL sockets, a special case for SSL sockets is
made so that the the socket reader installation can be delayed until
after the socket is encrypted (as this is the only supported mode of
operation with StreamSocket).
Change-Id: I693229189722dc43b221b167e8256f5497a50346
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Diffstat (limited to 'src/network/socket/qnativesocketengine_winrt_p.h')
-rw-r--r-- | src/network/socket/qnativesocketengine_winrt_p.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h index bf23faeb45..adb24a84c9 100644 --- a/src/network/socket/qnativesocketengine_winrt_p.h +++ b/src/network/socket/qnativesocketengine_winrt_p.h @@ -134,6 +134,9 @@ signals: void readReady(); void writeReady(); +private slots: + void establishRead(); + private: Q_DECLARE_PRIVATE(QNativeSocketEngine) Q_DISABLE_COPY(QNativeSocketEngine) @@ -192,17 +195,22 @@ public: bool checkProxy(const QHostAddress &address); bool fetchConnectionParameters(); + private: - Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocket> tcp; - Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IDatagramSocket> udp; + inline ABI::Windows::Networking::Sockets::IStreamSocket *tcpSocket() const + { return reinterpret_cast<ABI::Windows::Networking::Sockets::IStreamSocket *>(socketDescriptor); } + inline ABI::Windows::Networking::Sockets::IDatagramSocket *udpSocket() const + { return reinterpret_cast<ABI::Windows::Networking::Sockets::IDatagramSocket *>(socketDescriptor); } Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> tcpListener; Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBuffer> readBuffer; + Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncAction> connectOp; QBuffer readBytes; QMutex readMutex; QList<ABI::Windows::Networking::Sockets::IDatagramSocketMessageReceivedEventArgs *> pendingDatagrams; QList<ABI::Windows::Networking::Sockets::IStreamSocket *> pendingConnections; QList<ABI::Windows::Networking::Sockets::IStreamSocket *> currentConnections; QEventLoop eventLoop; + QAbstractSocket *sslSocket; HRESULT handleBindCompleted(ABI::Windows::Foundation::IAsyncAction *, ABI::Windows::Foundation::AsyncStatus); HRESULT handleNewDatagram(ABI::Windows::Networking::Sockets::IDatagramSocket *socket, |