mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 09:39:56 +00:00
Exit gracefully if server is not running instead of waiting forever
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
var io = require('socket.io-client');
|
||||
var socket = io('http://localhost:3000');
|
||||
socket.emit('slide change', process.argv[2], function () {
|
||||
socket.close();
|
||||
socket.on('connect_error', function(){
|
||||
console.log('connection error');
|
||||
socket.close();
|
||||
});
|
||||
socket.emit('slide change', process.argv[2], function(){
|
||||
socket.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user