socketio / socket.io-p2p

MIT License
1.03k stars 179 forks source link

Are function callbacks arguments supposed to work just like socket.io function callbacks? #22

Open BrianAdams opened 8 years ago

BrianAdams commented 8 years ago

When I setup my listener for the P2P connection and pass a function callback using emit, I would expect the P2P API to work just like the socket.io API. In which case I would expect the callback argument of the on handler would be populated with a function. Instead I get a null.

//client
p2p.emit('some-event,function(result){
  console.log(result);
});

//server
p2p.on('some-event',function(callback){
callback('got message'); //when using socket.io-p2p, the callback is always null
});