Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894280
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/support/aphlict/server/lib/AphlictListenerList.js b/support/aphlict/server/lib/AphlictListenerList.js
index 2681bf7746..904b172e6f 100644
--- a/support/aphlict/server/lib/AphlictListenerList.js
+++ b/support/aphlict/server/lib/AphlictListenerList.js
@@ -1,62 +1,59 @@
var JX = require('javelin').JX;
JX.require('AphlictListener', __dirname);
JX.install('AphlictListenerList', {
construct: function() {
this._listeners = {};
},
members: {
_listeners: null,
_nextID: 0,
- _activeListenerCount: 0,
_totalListenerCount: 0,
addListener: function(socket) {
var listener = new JX.AphlictListener(this._generateNextID(), socket);
this._listeners[listener.getID()] = listener;
- this._activeListenerCount++;
this._totalListenerCount++;
return listener;
},
removeListener: function(listener) {
var id = listener.getID();
if (id in this._listeners) {
delete this._listeners[id];
- this._activeListenerCount--;
}
},
getListeners: function() {
var keys = Object.keys(this._listeners);
var listeners = [];
for (var i = 0; i < keys.length; i++) {
listeners.push(this._listeners[keys[i]]);
}
return listeners;
},
getActiveListenerCount: function() {
- return this._activeListenerCount;
+ return Object.keys(this._listeners).length;
},
getTotalListenerCount: function() {
return this._totalListenerCount;
},
_generateNextID: function() {
do {
this._nextID = ((this._nextID + 1) % 1000000000000);
} while (this._nextID in this._listeners);
return this._nextID;
}
}
});
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 19:41 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128071
Default Alt Text
(1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment