[Pkg-javascript-commits] [sockjs-client] 172/434: sockjs-node API refactoring continues.
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 8fe54e06a8a12799b6f09359323d71660e92a89c
Author: Marek Majkowski <majek04 at gmail.com>
Date: Thu Oct 20 12:45:31 2011 +0100
sockjs-node API refactoring continues.
---
tests/sockjs_app.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/sockjs_app.js b/tests/sockjs_app.js
index 3e3b418..385590a 100644
--- a/tests/sockjs_app.js
+++ b/tests/sockjs_app.js
@@ -7,12 +7,12 @@ exports.install = function(config, server) {
conn.on('close', function() {
console.log(' [-] echo close ' + conn);
});
- conn.on('message', function(m) {
+ conn.on('data', function(m) {
var d = JSON.stringify(m);
console.log(' [ ] echo message ' + conn,
d.slice(0,64)+
((d.length > 64) ? '...' : ''));
- conn.send(m);
+ conn.write(m);
});
});
@@ -30,7 +30,7 @@ exports.install = function(config, server) {
console.log(' [+] ticker open ' + conn);
var tref;
var schedule = function() {
- conn.send('tick!');
+ conn.write('tick!');
tref = setTimeout(schedule, 1000);
};
tref = setTimeout(schedule, 1000);
@@ -49,10 +49,10 @@ exports.install = function(config, server) {
delete broadcast[conn.id];
console.log(' [-] broadcast close' + conn);
});
- conn.on('message', function(m) {
+ conn.on('data', function(m) {
console.log(' [-] broadcast message', m);
for(var id in broadcast) {
- broadcast[id].send(m);
+ broadcast[id].write(m);
}
});
});
@@ -63,11 +63,11 @@ exports.install = function(config, server) {
conn.on('close', function() {
console.log(' [-] amp close ' + conn);
});
- conn.on('message', function(m) {
+ conn.on('data', function(m) {
var n = Math.floor(Number(m));
n = (n > 0 && n < 19) ? n : 1;
console.log(' [ ] amp message: 2^' + n);
- conn.send(Array(Math.pow(2, n)+1).join('x'));
+ conn.write(Array(Math.pow(2, n)+1).join('x'));
});
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list