Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_network_kernel_qnetworkdatagram.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5 void Server::readPendingDatagrams()
6 {
7 while (udpSocket->hasPendingDatagrams()) {
8 QNetworkDatagram datagram = udpSocket->receiveDatagram();
9 QByteArray replyData = processThePayload(datagram.data());
10 udpSocket->writeDatagram(datagram.makeReply(replyData));
11 }
12 }
14
16 udpSocket->writeDatagram(std::move(datagram).makeReply(replyData));
\inmodule QtCore
Definition qbytearray.h:57
The QNetworkDatagram class provides the data and metadata of a UDP datagram.