Added communication structure

This commit is contained in:
logsol 2012-07-08 01:37:53 +02:00
parent 980af70259
commit 94f63fc7b2
10 changed files with 292 additions and 129 deletions

15
lib/Protocol/Parser.js Normal file
View file

@ -0,0 +1,15 @@
define(function() {
function Parser() {
}
Parser.prototype.encode = function(message){
return JSON.stringify(message);
}
Parser.prototype.decode = function(message){
return JSON.parse(message);
}
return Parser;
});