Skip to content

Commit 4af1fd2

Browse files
pierremoreauepriestley
authored and
epriestley
committedFeb 2, 2015
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
1 parent 0969b0d commit 4af1fd2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎support/aphlict/server/lib/AphlictClientServer.js

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ JX.install('AphlictClientServer', {
6969
}
7070
});
7171

72+
ws.on('close', function() {
73+
self.getListenerList().removeListener(listener);
74+
log('Disconnected.');
75+
});
76+
7277
wss.on('close', function() {
7378
self.getListenerList().removeListener(listener);
7479
log('Disconnected.');

0 commit comments

Comments
 (0)
Failed to load comments.