History

replace UDPSocket with QUDPSocket

Stephen Birarda committed 12 years ago

Commit 141394a1 parent d21583d61 files · +521 −1386Browse files

Showing the changes to interface/src/DataServerClient.cpp (1 of 61 files). Show all

Unified · Split

interface/src/DataServerClient.cpp+8−7
@@ -7,10 +7,10 @@ · 6 unmodified lines
77 //
88
99 #include <QtCore/QUrl>
10+#include <QtNetwork/QUdpSocket>
1011
1112 #include <NodeList.h>
1213 #include <PacketHeaders.h>
13−#include <UDPSocket.h>
1414 #include <UUID.h>
1515
1616 #include "Application.h"
@@ -24,7 +24,7 @@ const char MULTI_KEY_VALUE_SEPARATOR = '|'; · 7 unmodified lines
2424
2525 const char DATA_SERVER_HOSTNAME[] = "data.highfidelity.io";
2626 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);
2828
2929 void DataServerClient::putValueForKey(const QString& key, const char* value) {
3030 QString clientString = Application::getInstance()->getProfile()->getUserString();
@@ -57,7 +57,8 @@ void DataServerClient::putValueForKey(const QString& key, const char* value) { · 26 unmodified lines
5757 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(putPacket, numPacketBytes));
5858
5959 // 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());
6162 }
6263 }
6364
@@ -96,7 +97,8 @@ void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, co · 32 unmodified lines
9697 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes));
9798
9899 // 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());
100102 }
101103 }
102104
@@ -236,8 +238,7 @@ void DataServerClient::resendUnmatchedPackets() { · 133 unmodified lines
236238 mapIterator != _unmatchedPackets.end();
237239 ++mapIterator) {
238240 // 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());
242243 }
243244 }