I have asimple 1 to 1 client and server nodejs based application. The nodejs is running on Linux(Intel Edison). What I am trying to make happen is for the Linux server to reboot automatically whenever the socket is broken. Is this possible?
This is my simple node-socketIO server
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(socket){
socket.on('chat message', function(msg){
console.log(msg)
io.emit('chat message', msg);
});
socket.on('disconnect', function(){
//how to programmatically reboot?
console.log('user disconnected');
});
});
http.listen(3000, function(){
console.log('listening on *:3000 yeah');
});