3d-interface/socket.js

19 lines
483 B
JavaScript
Raw Normal View History

2015-06-09 17:40:58 +02:00
var fs = require('fs');
2015-06-29 15:41:18 +02:00
var geo = require('./lib/geo.min.js');
2015-06-09 17:40:58 +02:00
module.exports = function(io) {
io.on('connection', function(socket) {
2015-06-10 11:24:59 +02:00
2015-07-02 14:42:54 +02:00
console.log('[SOK] ' + new Date() + ' ' + socket.conn.remoteAddress + ' connection');
socket.on('disconnect', function() {
console.log('[SOK] ' + new Date() + ' ' + socket.conn.remoteAddress + ' disconnect');
});
2015-07-02 14:37:07 +02:00
2015-06-15 17:04:19 +02:00
var streamer = new geo.MeshStreamer();
2015-06-10 11:24:59 +02:00
2015-06-15 17:04:19 +02:00
streamer.start(socket);
2015-06-09 17:40:58 +02:00
});
};