2015-06-20 134 views
0

我使用socket.io与0.9.16版本,当我升级它,io.sockets.socket不起作用socket.io - 升级

io.sockets.socket(usernames[usr]).emit('event', msg, username); 

这个“窝”没有按”后错误在socket.io 1.3.5 牛逼的工作,我有这个错误

Missing error handler on `socket`. 
TypeError: Property 'sockets' of object #<Server> is not a function 
    at Socket.<anonymous> (E:\xamp\htdocs\connexion\test_server_2.js:260:8) 
    at Socket.emit (events.js:106:17) 

回答

1
io.sockets.connected[usernames[usr]].emit('event', msg, username); 

法1.0

+0

由于它的作品改变了!!!!!!! –