winrt: Remove unneeded function
Change-Id: I62f3abcabf1a0e5f909c603cbdcf407e36bd0402 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
This commit is contained in:
parent
f3db6971ee
commit
e72b583bc2
@ -1699,41 +1699,6 @@ HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, IDatagramSocketMessageReceivedEventArgs *args)
|
||||
{
|
||||
qCDebug(lcNetworkSocketVerbose) << this << Q_FUNC_INFO;
|
||||
Q_Q(QNativeSocketEngine);
|
||||
Q_UNUSED(socket);
|
||||
|
||||
WinRtDatagram datagram;
|
||||
QHostAddress returnAddress;
|
||||
ComPtr<IHostName> remoteHost;
|
||||
HRESULT hr = args->get_RemoteAddress(&remoteHost);
|
||||
RETURN_OK_IF_FAILED("Could not obtain remote host");
|
||||
HString remoteHostString;
|
||||
remoteHost->get_CanonicalName(remoteHostString.GetAddressOf());
|
||||
RETURN_OK_IF_FAILED("Could not obtain remote host's canonical name");
|
||||
returnAddress.setAddress(qt_QStringFromHString(remoteHostString));
|
||||
datagram.header.senderAddress = returnAddress;
|
||||
HString remotePort;
|
||||
hr = args->get_RemotePort(remotePort.GetAddressOf());
|
||||
RETURN_OK_IF_FAILED("Could not obtain remote port");
|
||||
datagram.header.senderPort = qt_QStringFromHString(remotePort).toInt();
|
||||
|
||||
ComPtr<IDataReader> reader;
|
||||
hr = args->GetDataReader(&reader);
|
||||
RETURN_OK_IF_FAILED("Could not obtain data reader");
|
||||
quint32 length;
|
||||
hr = reader->get_UnconsumedBufferLength(&length);
|
||||
RETURN_OK_IF_FAILED("Could not obtain unconsumed buffer length");
|
||||
datagram.data.resize(length);
|
||||
hr = reader->ReadBytes(length, reinterpret_cast<BYTE *>(datagram.data.data()));
|
||||
RETURN_OK_IF_FAILED("Could not read datagram");
|
||||
emit q->newDatagramReceived(datagram);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "qnativesocketengine_winrt.moc"
|
||||
|
@ -229,8 +229,6 @@ private:
|
||||
|
||||
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,
|
||||
ABI::Windows::Networking::Sockets::IStreamSocketListenerConnectionReceivedEventArgs *args);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user