How does websocket handle the number of unread messages

The

project should have a trigger mechanism similar to qq chat. When there is a message, the user does not read it and shows the number of unread messages. How to deal with this, especially when a user is chatting with another user and another user sends a message; how to tell if he has not read it?

Mar.11,2021

this isn't just about websocket, it's about your interface. If you didn't do the front end, you can define a read event for the front end to use properly.
if the front end is also done by you, depending on how you define "read", you can mark all unread messages sent by that person as read when you open the user's chat window, or mark the unread messages displayed as read when the chat window scrolls.

Menu