diff options
Diffstat (limited to 'examples/network')
-rw-r--r-- | examples/network/secureudpclient/association.cpp | 8 | ||||
-rw-r--r-- | examples/network/secureudpserver/server.cpp | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/network/secureudpclient/association.cpp b/examples/network/secureudpclient/association.cpp index 02009fe233..6b510909f1 100644 --- a/examples/network/secureudpclient/association.cpp +++ b/examples/network/secureudpclient/association.cpp @@ -74,8 +74,8 @@ DtlsAssociation::DtlsAssociation(const QHostAddress &address, quint16 port, DtlsAssociation::~DtlsAssociation() { - if (crypto.connectionEncrypted()) - crypto.sendShutdownAlert(&socket); + if (crypto.isConnectionEncrypted()) + crypto.shutdown(&socket); } void DtlsAssociation::startHandshake() @@ -108,7 +108,7 @@ void DtlsAssociation::readyRead() } dgram.resize(bytesRead); - if (crypto.connectionEncrypted()) { + if (crypto.isConnectionEncrypted()) { const QByteArray plainText = crypto.decryptDatagram(&socket, dgram); if (plainText.size()) { emit serverResponse(name, dgram, plainText); @@ -128,7 +128,7 @@ void DtlsAssociation::readyRead() emit errorMessage(tr("%1: handshake error - %2").arg(name, crypto.dtlsErrorString())); return; } - if (crypto.connectionEncrypted()) { + if (crypto.isConnectionEncrypted()) { emit infoMessage(tr("%1: encrypted connection established!").arg(name)); pingTimer.start(); pingTimeout(); diff --git a/examples/network/secureudpserver/server.cpp b/examples/network/secureudpserver/server.cpp index c5887c9adb..763024e4f4 100644 --- a/examples/network/secureudpserver/server.cpp +++ b/examples/network/secureudpserver/server.cpp @@ -158,7 +158,7 @@ void DtlsServer::readyRead() if (client == knownClients.end()) return handleNewConnection(peerAddress, peerPort, dgram); - if ((*client)->connectionEncrypted()) { + if ((*client)->isConnectionEncrypted()) { decryptDatagram(*client, dgram); if ((*client)->dtlsError() == QDtlsError::RemoteClosedConnectionError) knownClients.erase(client); @@ -226,7 +226,7 @@ void DtlsServer::doHandshake(DtlsConnection newConnection, const QByteArray &cli void DtlsServer::decryptDatagram(DtlsConnection connection, const QByteArray &clientMessage) { - Q_ASSERT(connection->connectionEncrypted()); + Q_ASSERT(connection->isConnectionEncrypted()); const QString peerInfo = peer_info(connection->peerAddress(), connection->peerPort()); const QByteArray dgram = connection->decryptDatagram(&serverSocket, clientMessage); @@ -243,7 +243,7 @@ void DtlsServer::decryptDatagram(DtlsConnection connection, const QByteArray &cl void DtlsServer::shutdown() { for (DtlsConnection &connection : knownClients) - connection->sendShutdownAlert(&serverSocket); + connection->shutdown(&serverSocket); knownClients.clear(); serverSocket.close(); |