Fix HifiSockAddr references

This commit is contained in:
David Rowe 2021-07-21 19:54:40 +12:00
parent 74c2788a14
commit 320b5a2d22
4 changed files with 7 additions and 7 deletions

View file

@ -894,7 +894,7 @@ void NodeList::parseNodeFromPacketStream(QDataStream& packetStream) {
info.publicSocket.setAddress(_domainHandler.getIP()); 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.publicSocket.setSocketType(SocketType::UDP);
info.localSocket.setSocketType(SocketType::UDP); info.localSocket.setSocketType(SocketType::UDP);

View file

@ -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()) { switch (sockAddr.getSocketType()) {
case SocketType::UDP: case SocketType::UDP:
// WEBRTC TODO: The Qt documentation says that the following call shouldn't be used if the UDP socket is connected!!! // 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 #endif
} }
qint64 NetworkSocket::readDatagram(char* data, qint64 maxSize, HifiSockAddr* sockAddr) { qint64 NetworkSocket::readDatagram(char* data, qint64 maxSize, SockAddr* sockAddr) {
#if defined(WEBRTC_DATA_CHANNELS) #if defined(WEBRTC_DATA_CHANNELS)
// Read per preceding pendingDatagramSize() if any, otherwise alternate socket types. // Read per preceding pendingDatagramSize() if any, otherwise alternate socket types.
if (_pendingDatagramSizeSocketType == SocketType::UDP if (_pendingDatagramSizeSocketType == SocketType::UDP

View file

@ -14,7 +14,7 @@
#include <shared/WebRTC.h> #include <shared/WebRTC.h>
#include "../HifiSockAddr.h" #include "../SockAddr.h"
#include "../NodeType.h" #include "../NodeType.h"
#include "../SocketType.h" #include "../SocketType.h"
#if defined(WEBRTC_DATA_CHANNELS) #if defined(WEBRTC_DATA_CHANNELS)
@ -76,7 +76,7 @@ public:
/// @param datagram The datagram to send. /// @param datagram The datagram to send.
/// @param sockAddr The address to send to. /// @param sockAddr The address to send to.
/// @return The number of bytes if successfully sent, otherwise <code>-1</code>. /// @return The number of bytes if successfully sent, otherwise <code>-1</code>.
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. /// @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. /// @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 maxSize The maximum number of bytes to read.
/// @param sockAddr The destination to write the source network address into. /// @param sockAddr The destination to write the source network address into.
/// @return The number of bytes if successfully read, otherwise <code>-1</code>. /// @return The number of bytes if successfully read, otherwise <code>-1</code>.
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. /// @brief Gets the state of the UDP or WebRTC socket.

View file

@ -17,7 +17,7 @@
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QWebSocketServer> #include <QWebSocketServer>
#include "../HifiSockAddr.h" #include "../SockAddr.h"
/// @addtogroup Networking /// @addtogroup Networking
/// @{ /// @{