Showing the changes to interface/src/DataServerClient.cpp (1 of 61 files). Show all
Unified · Split
| @@ -7,10 +7,10 @@ · 6 unmodified lines | ||
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #include <QtCore/QUrl> |
| 10 | +#include <QtNetwork/QUdpSocket> | |
| 10 | 11 | |
| 11 | 12 | #include <NodeList.h> |
| 12 | 13 | #include <PacketHeaders.h> |
| 13 | −#include <UDPSocket.h> | |
| 14 | 14 | #include <UUID.h> |
| 15 | 15 | |
| 16 | 16 | #include "Application.h" |
| @@ -24,7 +24,7 @@ const char MULTI_KEY_VALUE_SEPARATOR = '|'; · 7 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | const char DATA_SERVER_HOSTNAME[] = "data.highfidelity.io"; |
| 26 | 26 | const unsigned short DATA_SERVER_PORT = 3282; |
| 27 | −const sockaddr_in DATA_SERVER_SOCKET = socketForHostnameAndHostOrderPort(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT); | |
| 27 | +const HifiSockAddr DATA_SERVER_SOCKET = HifiSockAddr(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT); | |
| 28 | 28 | |
| 29 | 29 | void DataServerClient::putValueForKey(const QString& key, const char* value) { |
| 30 | 30 | QString clientString = Application::getInstance()->getProfile()->getUserString(); |
| @@ -57,7 +57,8 @@ void DataServerClient::putValueForKey(const QString& key, const char* value) { · 26 unmodified lines | ||
| 57 | 57 | // _unmatchedPackets.insert(std::pair<unsigned char*, int>(putPacket, numPacketBytes)); |
| 58 | 58 | |
| 59 | 59 | // send this put request to the data server |
| 60 | − NodeList::getInstance()->getNodeSocket()->send((sockaddr*) &DATA_SERVER_SOCKET, putPacket, numPacketBytes); | |
| 60 | + NodeList::getInstance()->getNodeSocket().writeDatagram((char*) putPacket, numPacketBytes, | |
| 61 | + DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 61 | 62 | } |
| 62 | 63 | } |
| 63 | 64 | |
| @@ -96,7 +97,8 @@ void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, co · 32 unmodified lines | ||
| 96 | 97 | // _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes)); |
| 97 | 98 | |
| 98 | 99 | // send the get to the data server |
| 99 | − NodeList::getInstance()->getNodeSocket()->send((sockaddr*) &DATA_SERVER_SOCKET, getPacket, numPacketBytes); | |
| 100 | + NodeList::getInstance()->getNodeSocket().writeDatagram((char*) getPacket, numPacketBytes, | |
| 101 | + DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 100 | 102 | } |
| 101 | 103 | } |
| 102 | 104 | |
| @@ -236,8 +238,7 @@ void DataServerClient::resendUnmatchedPackets() { · 133 unmodified lines | ||
| 236 | 238 | mapIterator != _unmatchedPackets.end(); |
| 237 | 239 | ++mapIterator) { |
| 238 | 240 | // send the unmatched packet to the data server |
| 239 | − NodeList::getInstance()->getNodeSocket()->send((sockaddr*) &DATA_SERVER_SOCKET, | |
| 240 | − mapIterator->first, | |
| 241 | − mapIterator->second); | |
| 241 | + NodeList::getInstance()->getNodeSocket().writeDatagram((char*) mapIterator->first, mapIterator->second, | |
| 242 | + DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 242 | 243 | } |
| 243 | 244 | } |