From 320b5a2d22f7476c82c5da1cb33a994bbf27502c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 21 Jul 2021 19:54:40 +1200 Subject: [PATCH] Fix HifiSockAddr references --- libraries/networking/src/NodeList.cpp | 2 +- libraries/networking/src/udt/NetworkSocket.cpp | 4 ++-- libraries/networking/src/udt/NetworkSocket.h | 6 +++--- libraries/networking/src/webrtc/WebRTCSignalingServer.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 364bcc5b40..97080a349a 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -894,7 +894,7 @@ void NodeList::parseNodeFromPacketStream(QDataStream& packetStream) { info.publicSocket.setAddress(_domainHandler.getIP()); } - // WEBRTC TODO: Handle WebRTC-connected nodes. Probably need to include SocketType in HifiSockAddr << and >> + // WEBRTC TODO: Handle WebRTC-connected nodes. Probably need to include SocketType in SockAddr << and >> info.publicSocket.setSocketType(SocketType::UDP); info.localSocket.setSocketType(SocketType::UDP); diff --git a/libraries/networking/src/udt/NetworkSocket.cpp b/libraries/networking/src/udt/NetworkSocket.cpp index 16f847a068..4fdb4e83ff 100644 --- a/libraries/networking/src/udt/NetworkSocket.cpp +++ b/libraries/networking/src/udt/NetworkSocket.cpp @@ -125,7 +125,7 @@ qintptr NetworkSocket::socketDescriptor(SocketType socketType) const { } -qint64 NetworkSocket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& sockAddr) { +qint64 NetworkSocket::writeDatagram(const QByteArray& datagram, const SockAddr& sockAddr) { switch (sockAddr.getSocketType()) { case SocketType::UDP: // WEBRTC TODO: The Qt documentation says that the following call shouldn't be used if the UDP socket is connected!!! @@ -189,7 +189,7 @@ qint64 NetworkSocket::pendingDatagramSize() { #endif } -qint64 NetworkSocket::readDatagram(char* data, qint64 maxSize, HifiSockAddr* sockAddr) { +qint64 NetworkSocket::readDatagram(char* data, qint64 maxSize, SockAddr* sockAddr) { #if defined(WEBRTC_DATA_CHANNELS) // Read per preceding pendingDatagramSize() if any, otherwise alternate socket types. if (_pendingDatagramSizeSocketType == SocketType::UDP diff --git a/libraries/networking/src/udt/NetworkSocket.h b/libraries/networking/src/udt/NetworkSocket.h index dfd9fe5e72..64805282ec 100644 --- a/libraries/networking/src/udt/NetworkSocket.h +++ b/libraries/networking/src/udt/NetworkSocket.h @@ -14,7 +14,7 @@ #include -#include "../HifiSockAddr.h" +#include "../SockAddr.h" #include "../NodeType.h" #include "../SocketType.h" #if defined(WEBRTC_DATA_CHANNELS) @@ -76,7 +76,7 @@ public: /// @param datagram The datagram to send. /// @param sockAddr The address to send to. /// @return The number of bytes if successfully sent, otherwise -1. - qint64 writeDatagram(const QByteArray& datagram, const HifiSockAddr& sockAddr); + qint64 writeDatagram(const QByteArray& datagram, const SockAddr& sockAddr); /// @brief Gets the number of bytes waiting to be written. /// @details For UDP, there's a single buffer used for all destinations. For WebRTC, each destination has its own buffer. @@ -100,7 +100,7 @@ public: /// @param maxSize The maximum number of bytes to read. /// @param sockAddr The destination to write the source network address into. /// @return The number of bytes if successfully read, otherwise -1. - qint64 readDatagram(char* data, qint64 maxSize, HifiSockAddr* sockAddr = nullptr); + qint64 readDatagram(char* data, qint64 maxSize, SockAddr* sockAddr = nullptr); /// @brief Gets the state of the UDP or WebRTC socket. diff --git a/libraries/networking/src/webrtc/WebRTCSignalingServer.h b/libraries/networking/src/webrtc/WebRTCSignalingServer.h index e32133dd17..418becd8eb 100644 --- a/libraries/networking/src/webrtc/WebRTCSignalingServer.h +++ b/libraries/networking/src/webrtc/WebRTCSignalingServer.h @@ -17,7 +17,7 @@ #include #include -#include "../HifiSockAddr.h" +#include "../SockAddr.h" /// @addtogroup Networking /// @{