SocketIO名称空间的房间除外

时间:2014-06-06 00:11:20

标签: socket.io

在socketio 0.9命名空间中有方法

https://github.com/Automattic/socket.io/blob/0.9.14/lib/namespace.js#L122

/**
 * Adds a session id we should prevent relaying messages to (flag).
 *
 * @api public
 */

SocketNamespace.prototype.except = function (id) {
  this.flags.exceptions.push(id);
  return this;
};

在1.0中,除了消失了。

https://github.com/Automattic/socket.io/blob/master/lib/namespace.js

之前有效:

io.of('/foo').in(room).except(sockeId).emit(event, data);

不再有效,除了未知

这很糟糕:

io.of('/foo').broadcast.to(room).emit(event, data);
//'TypeError: Cannot call method \'to\' of undefined',

我在1.0中找不到flags.exception,无论如何都要从命名空间广播?

0 个答案:

没有答案
相关问题