MCPcopy Create free account
hub / github.com/SIPp/sipp / set_users

Method set_users

src/call_generation_task.cpp:252–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void CallGenerationTask::set_users(int new_users)
253{
254 if (!instance) {
255 /* Doesn't do anything, we must be in server mode. */
256 return;
257 }
258
259 if (new_users < 0) {
260 new_users = 0;
261 }
262 assert(users >= 0);
263
264 while (users < new_users) {
265 int userid;
266 if (!retiredUsers.empty()) {
267 userid = retiredUsers.back();
268 retiredUsers.pop_back();
269 } else {
270 userid = users + 1;
271 userVarMap[userid] = new VariableTable(userVariables);
272 }
273 freeUsers.push_front(userid);
274 users++;
275 }
276
277 users = open_calls_allowed = new_users;
278
279 last_rate_change_time = clock_tick;
280 calls_since_last_rate_change = 0;
281
282 assert(open_calls_user_setting);
283
284 instance->setRunning();
285}
286
287void CallGenerationTask::free_user(int userId)
288{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
setRunningMethod · 0.80

Tested by

no test coverage detected