summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2018-07-26 10:36:48 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2018-07-26 15:13:57 +0000
commit056fbf03a54b2e3ee20f8d677649e407e50cc018 (patch)
treef762537cca6a2a56be614c28b8b80420c143deb4 /examples
parenteed8141a7ce5c983840aeb74d711fb8a1388d91a (diff)
QDtls - refactor
This patch renames rather awkward 'remote' into more conventional 'peer' (similar to what we have in QAbstractSocket). Change-Id: Ifc45e538b8adf9cc076bd7aee693277829fd94dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/network/secureudpclient/association.cpp2
-rw-r--r--examples/network/secureudpserver/server.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/network/secureudpclient/association.cpp b/examples/network/secureudpclient/association.cpp
index c8397b9f9f..02009fe233 100644
--- a/examples/network/secureudpclient/association.cpp
+++ b/examples/network/secureudpclient/association.cpp
@@ -59,7 +59,7 @@ DtlsAssociation::DtlsAssociation(const QHostAddress &address, quint16 port,
{
auto configuration = QSslConfiguration::defaultDtlsConfiguration();
configuration.setPeerVerifyMode(QSslSocket::VerifyNone);
- crypto.setRemote(address, port);
+ crypto.setPeer(address, port);
crypto.setDtlsConfiguration(configuration);
connect(&crypto, &QDtls::handshakeTimeout, this, &DtlsAssociation::handshakeTimeout);
diff --git a/examples/network/secureudpserver/server.cpp b/examples/network/secureudpserver/server.cpp
index 918307013c..c5887c9adb 100644
--- a/examples/network/secureudpserver/server.cpp
+++ b/examples/network/secureudpserver/server.cpp
@@ -151,8 +151,8 @@ void DtlsServer::readyRead()
const auto client = std::find_if(knownClients.begin(), knownClients.end(),
[&](const DtlsConnection &connection){
- return connection->remoteAddress() == peerAddress
- && connection->remotePort() == peerPort;
+ return connection->peerAddress() == peerAddress
+ && connection->peerPort() == peerPort;
});
if (client == knownClients.end())
@@ -189,7 +189,7 @@ void DtlsServer::handleNewConnection(const QHostAddress &peerAddress,
DtlsConnection newConnection(new QDtls(QSslSocket::SslServerMode));
newConnection->setDtlsConfiguration(serverConfiguration);
- newConnection->setRemote(peerAddress, peerPort);
+ newConnection->setPeer(peerAddress, peerPort);
newConnection->connect(newConnection.data(), &QDtls::pskRequired,
this, &DtlsServer::pskRequired);
knownClients.push_back(newConnection);
@@ -209,8 +209,8 @@ void DtlsServer::doHandshake(DtlsConnection newConnection, const QByteArray &cli
return;
}
- const QString peerInfo = peer_info(newConnection->remoteAddress(),
- newConnection->remotePort());
+ const QString peerInfo = peer_info(newConnection->peerAddress(),
+ newConnection->peerPort());
switch (newConnection->handshakeState()) {
case QDtls::HandshakeInProgress:
emit infoMessage(peerInfo + tr(": handshake is in progress ..."));
@@ -228,7 +228,7 @@ void DtlsServer::decryptDatagram(DtlsConnection connection, const QByteArray &cl
{
Q_ASSERT(connection->connectionEncrypted());
- const QString peerInfo = peer_info(connection->remoteAddress(), connection->remotePort());
+ const QString peerInfo = peer_info(connection->peerAddress(), connection->peerPort());
const QByteArray dgram = connection->decryptDatagram(&serverSocket, clientMessage);
if (dgram.size()) {
emit datagramReceived(peerInfo, clientMessage, dgram);