socket.io + redis.js

115 views
Skip to first unread message

Chen Chin Voon

unread,
Mar 5, 2012, 9:43:08 PM3/5/12
to sock...@googlegroups.com
hi,

I am new in socket.io and redis.js.

last week i had try this code. below url:
https://gist.github.com/1391583

it was using redisStore to publish message to client.
but from the coding i found that. it still using socket.io to publish the message.

in here i would like to know
1. How to check the message was send by redis? because from the redis server i can't found any data.
2. Client side need change anything? or still using socket.io to receive the message.

Thanks
Chen

Dan Shaw

unread,
Mar 6, 2012, 11:28:19 AM3/6/12
to sock...@googlegroups.com
$ redis-cli
> monitor

- dshaw
--

Daniel Shaw
e: ds...@dshaw.com
p: +1 818.29.DSHAW
i: http://dshaw.com
c: http://linkedin.com/in/dshaw

Arnout Kazemier

unread,
Mar 6, 2012, 1:07:42 PM3/6/12
to sock...@googlegroups.com


Arnout Kazemier, Founder observe.it

http://observe.it - observing & learning from your visitors.

Skype: arnoutkazemier

Mobile: +31623254031

Arnout Kazemier

unread,
Mar 6, 2012, 1:09:33 PM3/6/12
to sock...@googlegroups.com
Lol, premature sending.

You can also just check the log out put of socket.io which outputs everything it receives and sends

Chen Chin Voon

unread,
Mar 6, 2012, 9:22:20 PM3/6/12
to sock...@googlegroups.com
Thanks guys reply

I also had try code myself below is my coding

//msg receive by client
socket.on('message', function(message){
        pub.publish(channel, message+":"+_channel);
    });

//send message to client
sub.on("message",function(channel, message) {
    io.sockets.in(channel).emit('message',message);
});

I am no sure it correct or not. but it work under redis~

Regards
Chen


Date: Tue, 6 Mar 2012 19:09:33 +0100
From: in...@3rd-eden.com
To: sock...@googlegroups.com
Subject: Re: socket.io + redis.js
Reply all
Reply to author
Forward
0 new messages