mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Added communication structure
This commit is contained in:
parent
980af70259
commit
94f63fc7b2
10 changed files with 292 additions and 129 deletions
15
lib/Protocol/Parser.js
Normal file
15
lib/Protocol/Parser.js
Normal 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;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue