| | |
| | | } |
| | | |
| | | mongoClient.connect(config.URL, function(err, db) { |
| | | if (err) return; |
| | | if (err) { |
| | | console.log(err.message); |
| | | return; |
| | | } |
| | | console.log('Connecting to Mongo DB at ' + config.URL); |
| | | |
| | | net.createServer().on('connection', function(socket){ |
| | |
| | | |
| | | socket.on('close', function(data) { |
| | | console.log('Closed socket: ' + socket.remoteAddress +' '+ socket.remotePort); |
| | | }); |
| | | |
| | | socket.on('close', function(data) { |
| | | console.log('Closed socket: ' + socket.remoteAddress + ' ' + socket.remotePort); |
| | | }); |
| | | }).listen(config.PORT, config.HOST); |
| | | |