S
S
sevic2020-04-26 02:41:23
PHP
sevic, 2020-04-26 02:41:23

Should I choose websockets, sse or something else, for example, to receive a notification on the site about a new message?

Let's say one user sent a message to another, the message was saved in the database. The recipient user, if online, should be notified that a new message has arrived. What to choose for this? I understand that it is better to use a web socket for chat, although it seems possible on sse. When correspondence goes online between 2 users, it is also a web socket. What is needed for a simple websocket notification, sse, long-polling, or is it possible to do without all this for such a task?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question