I want to push data to to all the connected socket when a rest api is called
I have a express based node js application.
On App launch, I create the socket server as mentioned in the docs.
And when the rest call is made, am pushing the data to socket client as
io.sockets.to('client_name').emit('message', 'Some message');
The problem is, this works fine, when I start the node/socket server and launch the client.
But when I restart the node/socket server , the client no longer receives the message. I will have to reload the client to start receiving the message.
What could be the issue
Aucun commentaire:
Enregistrer un commentaire