Answer the question
In order to leave comments, you need to log in
How is the chat in contact?
Please tell me how the chat in contact is arranged. I implemented a chat that is not very similar to the chat system in VK. There it is proposed to make a request to the server after a certain period of time for the presence of new messages in the database for a user with a certain id. It seems to me that this is not the best option for implementing this functionality, because making an infinite number of requests to the server after a very short period of time is not very optimal. Accordingly, it seems to me that on the initiative of the server, a connection is established with the client if there are messages for him in the database, after which a message is sent to him. Please correct me if I'm wrong and help me learn how the VK chat works. And what do they use: web sockets, sse, comet
Answer the question
In order to leave comments, you need to log in
Open the console and see that your browser is constantly sending requests to the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question