History

repair NetworkAccessManager returns, handle custom AS port in assignment-client

Stephen Birarda committed 12 years ago

Commit f19c5c91 parent 78920239 files · +27 −20Browse files

Showing the changes to assignment-client/src/AssignmentClient.cpp (1 of 9 files). Show all

Unified · Split

assignment-client/src/AssignmentClient.cpp+17−4
@@ -59,6 +59,7 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) : · 58 unmodified lines
5959 const QString ASSIGNMENT_POOL_OPTION = "pool";
6060 const QString ASSIGNMENT_WALLET_DESTINATION_ID_OPTION = "wallet";
6161 const QString CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION = "a";
62+ const QString CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION = "p";
6263
6364 Assignment::Type requestAssignmentType = Assignment::AllTypes;
6465
@@ -87,17 +88,29 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) : · 22 unmodified lines
8788
8889 // create a NodeList as an unassigned client
8990 NodeList* nodeList = NodeList::createInstance(NodeType::Unassigned);
91+
92+ unsigned short assignmentServerPort = DEFAULT_DOMAIN_SERVER_PORT;
93+
94+ // check for an overriden assignment server port
95+ if (argumentVariantMap.contains(CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION)) {
96+ assignmentServerPort =
97+ argumentVariantMap.value(CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION).toString().toUInt();
98+ }
99+
100+ HifiSockAddr assignmentServerSocket(DEFAULT_ASSIGNMENT_SERVER_HOSTNAME, assignmentServerPort);
90101
91102 // check for an overriden assignment server hostname
92103 if (argumentVariantMap.contains(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION)) {
93104 _assignmentServerHostname = argumentVariantMap.value(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION).toString();
94105
95− // set the custom assignment socket on our NodeList
96− HifiSockAddr customAssignmentSocket = HifiSockAddr(_assignmentServerHostname, DEFAULT_DOMAIN_SERVER_PORT);
97−
98− nodeList->setAssignmentServerSocket(customAssignmentSocket);
106+ // change the hostname for our assignment server
107+ assignmentServerSocket = HifiSockAddr(_assignmentServerHostname, assignmentServerSocket.getPort());
99108 }
109+
110+ nodeList->setAssignmentServerSocket(assignmentServerSocket);
100111
112+ qDebug() << "Assignment server socket is" << assignmentServerSocket;
113+
101114 // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required
102115 qDebug() << "Waiting for assignment -" << _requestAssignment;
103116

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t