Handle socket disconnection in clients

Asked

Viewed 35 times

0

For example:

  1. I have 5 mobile devices listening to events
  2. A device lost connection
  3. The server triggers an event
  4. Four connected devices receive the event
  5. Disconnected device loses event and then reconnects

He must receive the lost event.

But the server does not know which clients did not receive their event. What can I do?

  • Do you have a database? Do you keep any records of connected devices?

  • Yes I have database and a Rest API also for other app routines, but I don’t save the connected devices in the database.

  • If you save to the bank it is very easy, otherwise you will have to maintain an array with identifications on your server

  • But in addition to saving the connected clients I would have to make the clients warn the server if they received the event, then the server would send again so that did not warn, it would be something like this?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.