Skip to content

Commit

Permalink
- append connection number to userid. This allows us to track the co…
Browse files Browse the repository at this point in the history
…nnection for a user and clean

   up properly the users list when the user gets disconnected. Also, it allows us to track how many
   times a user gets disconnected in the meeting.
  • Loading branch information
ritzalam committed Jan 26, 2015
1 parent 71a2ca9 commit 05ea33b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Expand Up @@ -1347,7 +1347,7 @@ class ApiController {
// removing the user when the user reconnects after being disconnected. (ralam jan 22, 2015)
// We use underscore (_) to associate userid with the user. We are also able to track
// how many times a user reconnects or refresh the browser.
String newInternalUserID = us.internalUserId + "_" + us.incConnectionNum()
String newInternalUserID = us.internalUserId + "_" + us.incrementConnectionNum()

log.info("Found conference for " + us.fullname)
response.addHeader("Cache-Control", "no-cache")
Expand Down
Expand Up @@ -19,6 +19,8 @@

package org.bigbluebutton.api.domain;

import java.util.concurrent.atomic.AtomicInteger;

public class UserSession {
public String authToken = null;
public String internalUserId = null;
Expand All @@ -40,15 +42,11 @@ public class UserSession {
public String avatarURL;
public String configXML;

private int connections = 0;

public int getConnectionNum() {
return connections;
}
private AtomicInteger connections = new AtomicInteger(0);

public int incConnectionNum() {
connections += 1;
return connections;

public synchronized int incrementConnectionNum() {
return connections.incrementAndGet();
}


Expand Down

0 comments on commit 05ea33b

Please sign in to comment.