listening_211 的代码运行失败! channel.on('join', (id, client) => { this.clients[id] = client; this.subscriptions[id] = (senderId, message) => { if (id != senderId) { this.clients[id].write(message); } }; this.on('broadcast', this.subscriptions[id]); }); 其中箭头函数会导致‘TypeError: Cannot set property '::ffff:127.0.0.1:51761' of undefined’。
评论了
listening_211 的代码运行失败! channel.on('join', (id, client) => { this.clients[id] = client; this.subscriptions[id] = (senderId, message) => { if (id != senderId) { this.clients[id].write(message); } }; this.on('broadcast', this.subscriptions[id]); }); 其中箭头函数会导致‘TypeError: Cannot set property '::ffff:127.0.0.1:51761' of undefined’。