javascript socket io clients handled asynchronously code example
Example: emitting event on socket.io using async await
async function doesSocketAgree(){
await new Promise(resolve => {
socket.emit('doesOtherSocketAgree', otherSocketId, (answer) => {
resolve(answer);
});
});
}