Shortcut to on and emit. Pingpong as you receive the event and returns in the same role.
With socket "emit" I requested and received the data and then to "emit". I decided to reduce the process by creating the PingPong
npm install --save socket.io-pingpong
You can use ping pong or pp to call the methods
- emit(name, args, callback) Same socket.emit, but returns a given value on the server callback
- on(name, callback) socket.on the same as, but performs emit passing to the callback
var app = ;var server = ;var io = server;var pingpong = ;server; // you portapp;io;