beaglebone/main.js
// Create the socket for the OpenCV IPC, and return it in the callback
Create the socket for the OpenCV IPC, and return it in the callback
Create the socket for the OpenCV IPC and return it in the callback
function makeSocket(callback) {
  var socket = net.createServer(function(connection) { 
    log.info('webcam connected');
    connection.on('end', function() {
      log.info('webcam disconnected');
    });
    callback(null, connection);
  });
  socket.listen('/tmp/opencv.sock', function() { 
    log.info('server bound');
  });
  process.on( 'SIGINT', function() { socket.close(); });
  process.on( 'SIGTERM', function() { socket.close(); });
  process.on( 'uncaughtException', function() { socket.close(); });
}
function makeSocket ( callback ) { var socket = net . createServer ( function ( connection ) { log . info ( 'webcam connected' ) ; connection . on ( 'end' , function ( ) { log . info ( 'webcam disconnected' ) ; } ) ; callback ( null , connection ) ; } ) ; socket . listen ( '/tmp/opencv.sock' , function ( ) { log . info ( 'server bound' ) ; } ) ; process . on ( 'SIGINT' , function ( ) { socket . close ( ) ; } ) ; process . on ( 'SIGTERM' , function ( ) { socket . close ( ) ; } ) ; process . on ( 'uncaughtException' , function ( ) { socket . close ( ) ; } ) ; }
Create the socket for the OpenCV IPC, and return it in the callback
Create the socket for the OpenCV IPC and return it in the callback
//'connection' listener //'listening' listener