22 if (serverSocket.
bind(serverAddress, serverPort))
27void DtlsServer::readyRead()
33 if (verifiedClients.contains({address, port}) {
49void DtlsServer::updateServerSecret()
51 const QByteArray newSecret(generateCryptoStrongSecret());
52 if (newSecret.size()) {
53 usedCookies.append(newSecret);
61 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
Returns the state of the socket.
This class implements server-side DTLS cookie generation and verification.
bool verifyClient(QUdpSocket *socket, const QByteArray &dgram, const QHostAddress &address, quint16 port)
socket must be a valid pointer, dgram must be a non-empty datagram, address cannot be null,...
bool setCookieGeneratorParameters(const GeneratorParameters ¶ms)
Sets the secret and the cryptographic hash algorithm from params.
The QHostAddress class provides an IP address.
void readyRead()
This signal is emitted once every time new data is available for reading from the device's current re...
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host=nullptr, quint16 *port=nullptr)
Receives a datagram no larger than maxSize bytes and stores it in data.
qint64 pendingDatagramSize() const
Returns the size of the first pending UDP datagram.
constexpr Initialization Uninitialized
GLuint GLsizei const GLchar * message
GLuint GLuint64EXT address
if(qFloatDistance(a, b)<(1<< 7))
[0]