summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_winrt_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qnativesocketengine_winrt_p.h')
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 79530d57f1..085704275c 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -214,13 +214,27 @@ private:
{ return reinterpret_cast<ABI::Windows::Networking::Sockets::IDatagramSocket *>(socketDescriptor); }
Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> tcpListener;
Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncAction> connectOp;
+
+ // Protected by readOperationsMutex. Written in handleReadyRead (native callback)
QVector<Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncOperationWithProgress<ABI::Windows::Storage::Streams::IBuffer *, UINT32>>> pendingReadOps;
+
+ // Protected by readMutex. Written in handleReadyRead (native callback)
QBuffer readBytes;
- QMutex readMutex;
- bool emitOnNewDatagram;
+
+ // In case of TCP readMutex protects readBytes and bytesAvailable. In case of UDP it is
+ // pendingDatagrams. They are written inside native callbacks (handleReadyRead and
+ // handleNewDatagrams/putIntoPendingDatagramsList)
+ mutable QMutex readMutex;
+
+ // As pendingReadOps is changed inside handleReadyRead(native callback) it has to be protected
+ QMutex readOperationsMutex;
+
+ // Protected by readMutex. Written in handleReadyRead (native callback)
QAtomicInteger<int> bytesAvailable;
+ // Protected by readMutex. Written in handleNewDatagrams/putIntoPendingDatagramsList
QList<WinRtDatagram> pendingDatagrams;
+
QList<ABI::Windows::Networking::Sockets::IStreamSocket *> pendingConnections;
QList<ABI::Windows::Networking::Sockets::IStreamSocket *> currentConnections;
QEventLoop eventLoop;