69 if (serverSocket.
bind(serverAddress, serverPort))
74 void DtlsServer::readyRead()
80 if (verifiedClients.contains({address, port}) {
96 void DtlsServer::updateServerSecret()
98 const QByteArray newSecret(generateCryptoStrongSecret());
99 if (newSecret.size()) {
100 usedCookies.append(newSecret);
108 switch (verifyClient.dtlsError()) {
bool listen(const QHostAddress &address, quint16 port)
virtual bool bind(const QHostAddress &address, quint16 port=0, BindMode mode=DefaultForPlatform)
SocketState state() const
The QByteArray class provides an array of bytes.
This class implements server-side DTLS cookie generation and verification.
bool verifyClient(QUdpSocket *socket, const QByteArray &dgram, const QHostAddress &address, quint16 port)
bool setCookieGeneratorParameters(const GeneratorParameters ¶ms)
The QHostAddress class provides an IP address.\inmodule QtNetwork.
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
The QUdpSocket class provides a UDP socket.
qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host=nullptr, quint16 *port=nullptr)
qint64 pendingDatagramSize() const
constexpr Initialization Uninitialized
GLenum GLuint GLenum GLsizei const GLchar * message
GLuint GLuint64EXT address
if(!verifier.verifyClient(&socket, message, address, port))
[1]