Here is my base code I used at my startup PeopleRooms, using RedisStore instead of MemoryStore in Socket.IO. So that the application is capable to scale. And the also the "rooms" feature of Socket.io
Yes, you can. But this code only is to join multiple rooms. And you can leave rooms when event disconnect is raised. If understood correctly your question.
hi, very cool example!! i have one question though: I don't see any '.publish(...)' or '.subscribe(...)' - commands, is that just not covered by this is example or is socket.io taking care of that itself now? In other words: does this line 'io.set('store', new RedisStore({redisPub:pub, redisSub:sub, redisClient:store}));' take care of the redis-part?! i do not have to say '.publish(...)' on every event myself?
Yes Olaf, in the line: io.set('store', new RedisStore({redisPub:pub, redisSub:sub, redisClient:store}));' You are sending a publisher and a subscriber to Socket.io that it will use. So that work is made by socket.io.
hi ranu, te hablo de colombia, he estado tratando de correr y entender este ejemplo pero aun tengo algunas dudas, por ejemplo no pude hacerlo correr con redis, recibo algunos errores al momento de iniciar el server, podrias aclararme algunas dudas con respecto a este ejemplo ?
Hi, I'm sorry to bother you, but can you tell me where in the code we're actually subscribing each of the sockets to the specified Room, because I'm not really sure I understand how the messages can be sent from one user to the other if the user's connections are not subscribed to certain rooms. Thank you
Hi, I don't understand your question. But where I call the function "join", is to the user to join a Room. And when I call the function broadcast.to(Room) is to send a message to a room. Here you can find more information https://github.com/learnboost/socket.io , read the section rooms.
I'm Stephane from France. Nice article you have here. I'm currently learning socket.io and it's fun.
I went to have a look at your start-up at peoples room and I liked it. Specially the cartoon animation. Did you use some software to make that cartoon ? Your website is super cool !
9 comentarios:
Yes, you can. But this code only is to join multiple rooms. And you can leave rooms when event disconnect is raised. If understood correctly your question.
hi, very cool example!! i have one question though:
I don't see any '.publish(...)' or '.subscribe(...)' - commands, is that just not covered by this is example or is socket.io taking care of that itself now?
In other words: does this line 'io.set('store', new RedisStore({redisPub:pub, redisSub:sub, redisClient:store}));' take care of the redis-part?! i do not have to say '.publish(...)' on every event myself?
cheers
olaf
Yes Olaf, in the line: io.set('store', new RedisStore({redisPub:pub, redisSub:sub, redisClient:store}));' You are sending a publisher and a subscriber to Socket.io that it will use. So that work is made by socket.io.
hope it helps
Ranu
hi ranu, te hablo de colombia, he estado tratando de correr y entender este ejemplo pero aun tengo algunas dudas, por ejemplo no pude hacerlo correr con redis, recibo algunos errores al momento de iniciar el server, podrias aclararme algunas dudas con respecto a este ejemplo ?
jspot,
claro que si. Decime cual es tu duda.
Hi, I'm sorry to bother you, but can you tell me where in the code we're actually subscribing each of the sockets to the specified Room, because I'm not really sure I understand how the messages can be sent from one user to the other if the user's connections are not subscribed to certain rooms.
Thank you
Hi,
I don't understand your question. But where I call the function "join", is to the user to join a Room. And when I call the function broadcast.to(Room) is to send a message to a room. Here you can find more information https://github.com/learnboost/socket.io , read the section rooms.
Regards
Hola Ranu !
I'm Stephane from France. Nice article you have here. I'm currently learning socket.io and it's fun.
I went to have a look at your start-up at peoples room and I liked it. Specially the cartoon animation. Did you use some software to make that cartoon ? Your website is super cool !
Hope to see your start up succeed !
Stephane,
thanks for your comments. The video was made by: http://mambostudio.com.ar
Regards
Publicar un comentario