改node.js中socket遇到的问题
var socket.uid = 1;
clientRedis.hget( "LiveConnect_pull",socket.uid);
报错:This is converted to "[object Object]" by using .toString() now and will return an error from v.3.0 on.
改成以下就好了:
clientRedis.hget( "LiveConnect_pull",''+socket.uid+'');
原因很明显啦,传参要求格式必须是string
评论