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.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 13922cb397..d7b44174b0 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -54,6 +54,7 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#include <QtCore/QEventLoop>
#include <QtCore/QBuffer>
+#include <QtCore/QLoggingCategory>
#include <QtCore/QMutex>
#include <QtCore/QAtomicInteger>
#include "QtNetwork/qhostaddress.h"
@@ -63,6 +64,9 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcNetworkSocket)
+Q_DECLARE_LOGGING_CATEGORY(lcNetworkSocketVerbose)
+
namespace WinRTSocketEngine {
enum ErrorString {
NonBlockingInitFailedErrorString,
@@ -178,8 +182,7 @@ private slots:
void establishRead();
void handleConnectOpFinished(bool success, QAbstractSocket::SocketError error,
WinRTSocketEngine::ErrorString errorString);
- void handleNewDatagrams(const QList<WinRtDatagram> &datagram);
- void handleNewData(const QVector<QByteArray> &data);
+ void handleNewData();
void handleTcpError(QAbstractSocket::SocketError error);
private:
@@ -218,26 +221,14 @@ private:
{ return reinterpret_cast<ABI::Windows::Networking::Sockets::IDatagramSocket *>(socketDescriptor); }
Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> tcpListener;
- // 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;
-
- // Protected by readMutex. Written in handleReadyRead (native callback)
- QAtomicInteger<int> bytesAvailable;
-
- // Protected by readMutex. Written in handleNewData/putIntoPendingData (native callback)
- QVector<QByteArray> pendingData;
-
- // 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;
QAbstractSocket *sslSocket;
EventRegistrationToken connectionToken;
+ bool emitReadReady = true;
+
HRESULT handleNewDatagram(ABI::Windows::Networking::Sockets::IDatagramSocket *socket,
ABI::Windows::Networking::Sockets::IDatagramSocketMessageReceivedEventArgs *args);
HRESULT handleClientConnection(ABI::Windows::Networking::Sockets::IStreamSocketListener *tcpListener,