Aphlict - remove listeners when clients close the connection
Summary: Ref T7110. Listeners are now removed when clients close the connection to avoid stacking a never ending number of unused listeners. Test Plan: Using `wscat` to connect to the Aphlict server; when closing the connection a 'Diconnected.' will appear in the logs and the number of active listeners is decreased by one. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7110 Differential Revision: https://secure.phabricator.com/D11634
This commit is contained in:

committed by
epriestley

parent
0969b0d8c8
commit
4af1fd2a79
@@ -69,6 +69,11 @@ JX.install('AphlictClientServer', {
|
||||
}
|
||||
});
|
||||
|
||||
ws.on('close', function() {
|
||||
self.getListenerList().removeListener(listener);
|
||||
log('Disconnected.');
|
||||
});
|
||||
|
||||
wss.on('close', function() {
|
||||
self.getListenerList().removeListener(listener);
|
||||
log('Disconnected.');
|
||||
|
Reference in New Issue
Block a user