What @Biancheng said above is good, but the first point he said has nothing to do with the speed of message transmission. The cluster only increases the load capacity of the server.
Personal opinion: When you send a message, you need to have a specified action, such as clicking on the chat window of the person you want to send the message to. The moment you click on it, send a message to the server and establish a conversation connection. Of course. Very good server support. The same goes for receiving messages. When others click on your window to chat, the server automatically establishes a connection with you and sends you other people's information. When there is no message interaction for a period of time, or the software process detects shutdown, the connection is disconnected. This can greatly reduce the pressure on the server and establish an instant connection.
Let me add something: @Biancheng said that there are some problems in "establishing connections between clients". Think about it this way, if you establish a connection directly, there will be no files sent by you and the other party on the server. When you disconnect, you can download a file again. Where does this file come from? You can say caching. What about the news? We know that QQ and WeChat will store all the calls between you and the other party (it’s not impossible, it’s just that sometimes the case does not reach the level of contacting Tencent), so it is somewhat inappropriate to establish a connection between the two. @清天 said that the server will establish a connection with you when you click on the window. First of all, this connection is not established when you click on the window. Secondly, if the server automatically establishes a connection with you, it is called push. Obviously, the mobile phone (software) should actively establish a connection with the server, and the server can only listen for requests. In addition to what the above mentioned, I have one more thing to add, which is the size of the message sent. Multiple comparisons of sending one word vs. sending 100 words (exceeding the maximum length of a request), sending a few words vs. sending pictures, the former is due to different connections established, and the latter is due to different transmission protocols, servers, and storage algorithms. In summary, part of the reason for Mida is the small amount of data. Others include server architecture, networking, etc. -----Separating line--- Say something interesting, which is an expression. We know that sending emoticons can be replaced by text. For example, if we send [victory], a victory expression will appear. Likewise we send "[win]" and send the same number of "[]win[]win[]win[]win" and see which one "arrives" faster.
QQ server group is very powerful. It is conceivable that one server only corresponds to some users, and may maintain a long-term continuity
QQ When sending files and pictures, you can directly establish a connection between clients, and you can also send messages
Direct connections between clients are sometimes not as fast as going through the server - if the server and network are strong enough
I’m afraid the QQ server is not placed in one place. Do you know the principle of CDN?
Nothing but good network.
What @Biancheng said above is good, but the first point he said has nothing to do with the speed of message transmission. The cluster only increases the load capacity of the server.
Personal opinion: When you send a message, you need to have a specified action, such as clicking on the chat window of the person you want to send the message to. The moment you click on it, send a message to the server and establish a conversation connection. Of course. Very good server support. The same goes for receiving messages. When others click on your window to chat, the server automatically establishes a connection with you and sends you other people's information. When there is no message interaction for a period of time, or the software process detects shutdown, the connection is disconnected. This can greatly reduce the pressure on the server and establish an instant connection.
Let me add something:
@Biancheng said that there are some problems in "establishing connections between clients". Think about it this way, if you establish a connection directly, there will be no files sent by you and the other party on the server. When you disconnect, you can download a file again. Where does this file come from? You can say caching. What about the news? We know that QQ and WeChat will store all the calls between you and the other party (it’s not impossible, it’s just that sometimes the case does not reach the level of contacting Tencent), so it is somewhat inappropriate to establish a connection between the two.
@清天 said that the server will establish a connection with you when you click on the window. First of all, this connection is not established when you click on the window. Secondly, if the server automatically establishes a connection with you, it is called push. Obviously, the mobile phone (software) should actively establish a connection with the server, and the server can only listen for requests.
In addition to what the above mentioned, I have one more thing to add, which is the size of the message sent. Multiple comparisons of sending one word vs. sending 100 words (exceeding the maximum length of a request), sending a few words vs. sending pictures, the former is due to different connections established, and the latter is due to different transmission protocols, servers, and storage algorithms. In summary, part of the reason for Mida is the small amount of data. Others include server architecture, networking, etc.
-----Separating line---
Say something interesting, which is an expression. We know that sending emoticons can be replaced by text. For example, if we send [victory], a victory expression will appear. Likewise we send "[win]" and send the same number of "[]win[]win[]win[]win" and see which one "arrives" faster.