-2

How to emit event to only one (or two) client in "Flask-SocketIO"

1 Answers1

0

I also faced the same issue, what i did was

When i'm sending a message from the client to the server i always gave 2 parameters. 1 for the name of the function and sometimes data.

I added a 3th parameter called UID. Everytime a user connects to the socket it will generate a unqiue ID. You can look in the socket.io docs under ID. You could send this id to the server that handles everything and let the emit event only reach the client with that specific UID.

Jeroen Smink
  • 179
  • 1
  • 10