Showing the changes to interface/src/DataServerClient.cpp (1 of 2 files). Show all
Unified · Split
| @@ -24,7 +24,12 @@ const char MULTI_KEY_VALUE_SEPARATOR = '|'; · 23 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 HifiSockAddr DATA_SERVER_SOCKET = HifiSockAddr(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT); | |
| 27 | + | |
| 28 | + | |
| 29 | +const HifiSockAddr& DataServerClient::dataServerSockAddr() { | |
| 30 | + static HifiSockAddr dsSockAddr = HifiSockAddr(DATA_SERVER_HOSTNAME, DATA_SERVER_PORT); | |
| 31 | + return dsSockAddr; | |
| 32 | +} | |
| 28 | 33 | |
| 29 | 34 | void DataServerClient::putValueForKey(const QString& key, const char* value) { |
| 30 | 35 | QString clientString = Application::getInstance()->getProfile()->getUserString(); |
| @@ -58,7 +63,8 @@ void DataServerClient::putValueForKey(const QString& key, const char* value) { · 27 unmodified lines | ||
| 58 | 63 | |
| 59 | 64 | // send this put request to the data server |
| 60 | 65 | NodeList::getInstance()->getNodeSocket().writeDatagram((char*) putPacket, numPacketBytes, |
| 61 | − DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 66 | + dataServerSockAddr().getAddress(), | |
| 67 | + dataServerSockAddr().getPort()); | |
| 62 | 68 | } |
| 63 | 69 | } |
| 64 | 70 | |
| @@ -98,7 +104,8 @@ void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, co · 33 unmodified lines | ||
| 98 | 104 | |
| 99 | 105 | // send the get to the data server |
| 100 | 106 | NodeList::getInstance()->getNodeSocket().writeDatagram((char*) getPacket, numPacketBytes, |
| 101 | − DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 107 | + dataServerSockAddr().getAddress(), | |
| 108 | + dataServerSockAddr().getPort()); | |
| 102 | 109 | } |
| 103 | 110 | } |
| 104 | 111 | |
| @@ -239,6 +246,7 @@ void DataServerClient::resendUnmatchedPackets() { · 134 unmodified lines | ||
| 239 | 246 | ++mapIterator) { |
| 240 | 247 | // send the unmatched packet to the data server |
| 241 | 248 | NodeList::getInstance()->getNodeSocket().writeDatagram((char*) mapIterator->first, mapIterator->second, |
| 242 | − DATA_SERVER_SOCKET.getAddress(), DATA_SERVER_SOCKET.getPort()); | |
| 249 | + dataServerSockAddr().getAddress(), | |
| 250 | + dataServerSockAddr().getPort()); | |
| 243 | 251 | } |
| 244 | 252 | } |