mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 14:53:24 +02:00
VNC screen is visible (w/ RAW encoding). Size of VNC screen is still
hardcoded, preventing real use.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
var net = require('net')
|
||||
var util = require('util')
|
||||
|
||||
var EventEmitter = require('eventemitter3').EventEmitter
|
||||
@@ -8,18 +7,44 @@ var VncConnection = require('./connection')
|
||||
|
||||
function VncServer(server) {
|
||||
this._bound = {
|
||||
_connectionListener: this._connectionListener.bind(this)
|
||||
_listeningListener: this._listeningListener.bind(this)
|
||||
, _connectionListener: this._connectionListener.bind(this)
|
||||
, _closeListener: this._closeListener.bind(this)
|
||||
, _errorListener: this._errorListener.bind(this)
|
||||
}
|
||||
|
||||
this.server = server
|
||||
.on('listening', this._bound._listeningListener)
|
||||
.on('connection', this._bound._connectionListener)
|
||||
.on('close', this._bound._closeListener)
|
||||
.on('error', this._bound._errorListener)
|
||||
}
|
||||
|
||||
util.inherits(VncServer, EventEmitter)
|
||||
|
||||
VncServer.prototype.close = function() {
|
||||
this.server.close()
|
||||
}
|
||||
|
||||
VncServer.prototype.listen = function() {
|
||||
this.server.listen.apply(this.server, arguments)
|
||||
}
|
||||
|
||||
VncServer.prototype._listeningListener = function() {
|
||||
this.emit('listening')
|
||||
}
|
||||
|
||||
VncServer.prototype._connectionListener = function(conn) {
|
||||
debug('connection', conn.remoteAddress, conn.remotePort)
|
||||
new VncConnection(conn)
|
||||
this.emit('connection', new VncConnection(conn))
|
||||
}
|
||||
|
||||
VncServer.prototype._closeListener = function() {
|
||||
this.emit('close')
|
||||
}
|
||||
|
||||
VncServer.prototype._errorListener = function(err) {
|
||||
this.emit('error', err)
|
||||
}
|
||||
|
||||
module.exports = VncServer
|
||||
|
||||
Reference in New Issue
Block a user