diff --git a/examples/client_echo/client_echo.js b/examples/client_echo/client_echo.js index 1f64b4a..3407073 100644 --- a/examples/client_echo/client_echo.js +++ b/examples/client_echo/client_echo.js @@ -18,6 +18,9 @@ client.on('connect', function() { client.on('disconnect', function(packet) { console.log('disconnected: '+ packet.reason); }); +client.on('end', function(err) { + console.log('Connection lost'); +}); client.on('chat', function(packet) { var jsonMsg = JSON.parse(packet.message); if(jsonMsg.translate == 'chat.type.announcement' || jsonMsg.translate == 'chat.type.text') { diff --git a/examples/client_forge/client_forge.js b/examples/client_forge/client_forge.js index b8cb159..e4d9e0b 100644 --- a/examples/client_forge/client_forge.js +++ b/examples/client_forge/client_forge.js @@ -20,6 +20,9 @@ client.on('connect', function() { client.on('disconnect', function(packet) { console.log('disconnected: '+ packet.reason); }); +client.on('end', function(err) { + console.log('Connection lost'); +}); client.on('chat', function(packet) { var jsonMsg = JSON.parse(packet.message); if(jsonMsg.translate == 'chat.type.announcement' || jsonMsg.translate == 'chat.type.text') {