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
7//7//
8 8
9#include <QtCore/QUrl>9#include <QtCore/QUrl>
10#include <QtNetwork/QUdpSocket>
10 11
11#include <NodeList.h>12#include <NodeList.h>
12#include <PacketHeaders.h>13#include <PacketHeaders.h>
13#include <UDPSocket.h>
14#include <UUID.h>14#include <UUID.h>
15 15
16#include "Application.h"16#include "Application.h"
@@ -24,7 +24,7 @@ const char MULTI_KEY_VALUE_SEPARATOR = '|'; · 7 unmodified lines
24 24
25const char DATA_SERVER_HOSTNAME[] = "data.highfidelity.io";25const char DATA_SERVER_HOSTNAME[] = "data.highfidelity.io";
26const unsigned short DATA_SERVER_PORT = 3282;26const unsigned short DATA_SERVER_PORT = 3282;
27const sockaddr_in DATA_SERVER_SOCKET = socketForHostnameAndHostOrderPort(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT);27const HifiSockAddr DATA_SERVER_SOCKET = HifiSockAddr(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT);
28 28
29void DataServerClient::putValueForKey(const QString& key, const char* value) {29void DataServerClient::putValueForKey(const QString& key, const char* value) {
30 QString clientString = Application::getInstance()->getProfile()->getUserString();30 QString clientString = Application::getInstance()->getProfile()->getUserString();
@@ -57,7 +57,8 @@ void DataServerClient::putValueForKey(const QString& key, const char* value) { · 26 unmodified lines
57 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(putPacket, numPacketBytes));57 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(putPacket, numPacketBytes));
58 58
59 // send this put request to the data server59 // 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 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes));97 // _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes));
97 98
98 // send the get to the data server99 // 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 mapIterator != _unmatchedPackets.end();238 mapIterator != _unmatchedPackets.end();
237 ++mapIterator) {239 ++mapIterator) {
238 // send the unmatched packet to the data server240 // send the unmatched packet to the data server
239 NodeList::getInstance()->getNodeSocket()->send((sockaddr*) &DATA_SERVER_SOCKET,241 NodeList::getInstance()->getNodeSocket().writeDatagram((char*) mapIterator->first, mapIterator->second,
240 mapIterator->first,242 DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort());
241 mapIterator->second);
242 }243 }
243}244}