Exit the loop if the client wants to disconnect; fixes #30

This commit is contained in:
Roy Hyunjin Han 2013-11-18 10:43:31 -08:00
commit 5ccb32f338
6 changed files with 46 additions and 7 deletions

View file

@ -48,6 +48,9 @@ var main = io.of('').on('connection', function(socket) {
fn(payload);
}
});
socket.on('wait_with_disconnect', function() {
socket.emit('wait_with_disconnect_response');
});
});
var chat = io.of('/chat').on('connection', function (socket) {