Socket.io,Redis Store和IE
我使用Redis,Socket.io,theres 2 nodejs服务器运行diff socket.io客户端。 我通过redis存储与两个socket.io客户端进行通信,这样我就可以随时发送到所有套接字。 它工作。
io.sockets.emit('successful_connection', { success : true }); return;
我的问题是,当即通过ID调用一个特定的套接字,它失败。
io.sockets.socket(socketId).emit('successful_connection', { success : true }); return;
我不知道为什么,它适用于所有其他浏览器。 下面是用于socket.io/redisconfiguration的代码
io.configure(function(){ var RedisStore = require('socket.io').RedisStore, opts = {host: **.***.**.**, port: ****}; io.set('store', new RedisStore({redisPub:opts, redisSub:opts, redisClient:opts})); });
任何build议将是有益的,现在我的主要思想是“为什么有nodejs / socket.io服务器”。 如果我必须处理这个,是否真的有好处? 谢谢
此示例代码的博客文章可能会帮助你。