Socket.io、Redis Store 和 IE [英] Socket.io, Redis Store and IE

查看:52
本文介绍了Socket.io、Redis Store 和 IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Redis 和 Socket.io 的游戏,有 2 个运行 diff socket.io 客户端的 nodejs 服务器.我正在通过 redis 存储与 socket.io 客户端进行通信,这样我就可以随时向所有套接字发送.它有效.

I got a game using Redis, Socket.io, theres 2 nodejs servers running diff socket.io clients. I am communicating with both socket.io clients through the redis store, that way I can emit to all sockets whenever I want. And it works.

io.sockets.emit('successful_connection', { success : true }); return;

我的问题是,当即通过 id 调用特定套接字时,它失败了.

My problem is, when ie calling a specific socket by id, it fails.

io.sockets.socket(socketId).emit('successful_connection', { success : true }); return;

我不知道为什么,它适用于所有其他浏览器.这是socket.io/redis store config的代码

I have no idea why, it works in all other browsers. Heres the code for socket.io/redis store config

    io.configure(function(){
        var RedisStore = require('socket.io').RedisStore,
            opts = {host: **.***.**.**, port: ****};
        io.set('store', new RedisStore({redisPub:opts, redisSub:opts, redisClient:opts}));
    });     

任何建议都会有所帮助,现在我的主要想法是为什么要有 nodejs/socket.io 服务器."如果我必须处理这个,真的有好处吗?谢谢

Any advice would be helpful, right now my main thought is "why have nodejs/socket.io servers." Is there really a benefit if i have to deal with this. Thanks

推荐答案

这篇 包含示例代码的博客文章可能会对您有所帮助.

This blog post with example code might help you.

这篇关于Socket.io、Redis Store 和 IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆