src/socketpool.js
function send(pool, id, event, message) {
  const socket = pool.sockets.connected[id];
  if (socket) {
    return socket.emit(event, message);
  } else {
    console.log(`Cannot send ${event} to disconnected socket ${id}`);
  }
}
function send(pool, id, event, message) {
  const socket = pool.sockets.connected[id];
  if (socket) {
    return socket.emit(event, message);
  } else {
    console.log(`Cannot send ${event} to disconnected socket ${id}`);
  }
}
function send ( pool , id , event , message ) { const socket = pool . sockets . connected [ id ] ; if ( socket ) { return socket . emit ( event , message ) ; } else { console . log ( ` ${ event } ${ id } ` ) ; } }
Sends a message to a single socket connected to socket.io.

@param  {Object} pool    The socket.io connection pool.
@param  {String} id      The socket's ID.
@param  {String} event   The name of the event to emit.
@param  {Any}    message The serializable message to send.

@return {undefined}
Sends a message to a single socket connected to socket . io .