From 0ef1a5c04fc8ccf8f9cdeaeeb5fdf9dc230a80ee Mon Sep 17 00:00:00 2001 From: h-4nd-h Date: Sun, 26 Jun 2022 17:39:00 +0430 Subject: [PATCH] Comply with bio standard --- socket.cpp | 6 +++--- socket.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/socket.cpp b/socket.cpp index 8488596..2bbaf1b 100644 --- a/socket.cpp +++ b/socket.cpp @@ -7,7 +7,7 @@ UdpSocket::UdpSocket(QObject* parent, quint16 port) : { _socket = new QUdpSocket(this); _socket->bind(QHostAddress::LocalHost, port); - connect(_socket, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(_socket, &QUdpSocket::readyRead, this, &UdpSocket::readyRead); } UdpSocket::~UdpSocket() @@ -39,8 +39,8 @@ void UdpSocket::readyRead() { QByteArray Buffer; Buffer.resize(_socket->pendingDatagramSize()); - QHostAddress sender_addr{}; - quint16 sender_port{}; + QHostAddress sender_addr; + quint16 sender_port; _socket->readDatagram(Buffer.data(), Buffer.size(), &sender_addr, &sender_port); qDebug() << "New Message arrived at" << getTime(); diff --git a/socket.h b/socket.h index b62fd5c..51ea612 100644 --- a/socket.h +++ b/socket.h @@ -16,6 +16,7 @@ private: public: explicit UdpSocket(QObject* parent = nullptr, quint16 port = 1234); + ~UdpSocket(); void sayHello(); void sayMsg(QString Msg);