Ans: You can try the below code to send a message to a particular client with socket.io.
Whenever the user joins into the server, the socket details will be generated including the ID. The UD is responsible for sending a message to a particular person or people.
The primary step is to store all the socket.ids in an array.
person[name] = socket.id;
The name will be the receiver name.
If you want to unleash your potential in this competitive field, please visit the Web Development Training page for more information, where you can find the and as well.
For more updates on the latest courses stay tuned to HKR Trainings.