Added a method to retrieve buffers from controler and logs to debug

This commit is contained in:
2014-11-03 17:45:39 +01:00
parent ddc9d67128
commit 1414d634fd
2 changed files with 14 additions and 4 deletions

View File

@@ -14,7 +14,13 @@ server.createServer(3219, "127.0.0.1", function (password) {
process.stdin.on("data", function(data) { process.stdin.on("data", function(data) {
if (data.toString() !== "exit"){ if (data.toString() !== "exit"){
eval(data.toString()); try {
console.log("CMD : "+data.toString());
console.log("RETURNED : "+eval(data.toString()));
}
catch (ex) {
console.log("Erreur : "+ex.message)
}
} }
else { else {

View File

@@ -59,7 +59,7 @@ function NetbeansClient(socket, authentication, onEvent, onError, onDisconnected
messageTransform.on("data",function (data) { messageTransform.on("data",function (data) {
var message = data.toString(); var message = data.toString();
console.log(message); console.log("MSG : "+message);
/* The first message must be an authentication one */ /* The first message must be an authentication one */
if (message.indexOf("AUTH ") === 0 && authentication(message.substring(message.indexOf(" ") + 1))) { if (message.indexOf("AUTH ") === 0 && authentication(message.substring(message.indexOf(" ") + 1))) {
@@ -68,7 +68,7 @@ function NetbeansClient(socket, authentication, onEvent, onError, onDisconnected
messageTransform.removeAllListeners("data"); messageTransform.removeAllListeners("data");
messageTransform.on("data", function(data) { messageTransform.on("data", function(data) {
var message = data.toString(); var message = data.toString();
console.log(message); console.log("MSG "+message);
try { try {
var iName = 0; /*Index of the name separator in case of an Event */ var iName = 0; /*Index of the name separator in case of an Event */
@@ -364,7 +364,7 @@ function Controler(socket, authentication) {
}; };
/* CONNEXION CONTROL */ /* CONNTROLER CONTROL */
//Close the underlying connexion with Vim, but not Vim //Close the underlying connexion with Vim, but not Vim
this.detach = function () { this.detach = function () {
@@ -377,6 +377,10 @@ function Controler(socket, authentication) {
socket.end("DISCONNECT\n"); socket.end("DISCONNECT\n");
self.emit("disconnected"); self.emit("disconnected");
}; };
this.getBuffer = function(buffId) {
return buffers[buffId];
};
} }
Controler.prototype = EventEmitter.prototype; Controler.prototype = EventEmitter.prototype;