mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 14:53:24 +02:00
Clean up structure a little bit for initial testing.
This commit is contained in:
25
lib/units/device/plugins/vnc/util/server.js
Normal file
25
lib/units/device/plugins/vnc/util/server.js
Normal file
@@ -0,0 +1,25 @@
|
||||
var net = require('net')
|
||||
var util = require('util')
|
||||
|
||||
var EventEmitter = require('eventemitter3').EventEmitter
|
||||
var debug = require('debug')('vnc:server')
|
||||
|
||||
var VncConnection = require('./connection')
|
||||
|
||||
function VncServer(server) {
|
||||
this._bound = {
|
||||
_connectionListener: this._connectionListener.bind(this)
|
||||
}
|
||||
|
||||
this.server = server
|
||||
.on('connection', this._bound._connectionListener)
|
||||
}
|
||||
|
||||
util.inherits(VncServer, EventEmitter)
|
||||
|
||||
VncServer.prototype._connectionListener = function(conn) {
|
||||
debug('connection', conn.remoteAddress, conn.remotePort)
|
||||
new VncConnection(conn)
|
||||
}
|
||||
|
||||
module.exports = VncServer
|
||||
Reference in New Issue
Block a user