IM Technology Research_Andy’s Papa’s Blog
Protocol Selection What network transmission protocol (TCP/UDP/HTTP) to use? Although the udp protocol has better real-time performance, how to deal with safe and reliable transmission and message interaction between different clients is a difficult problem, and it is too complicated to implement. At present, most IM architectures do not use UDP to implement. HTTP HTTP can be used to implement the status protocol, and the pull mode is used for offline messages to avoid excessive pressure on the tcp channel and affect the efficiency of instant message delivery. When chatting with pictures via IM: http can easily handle functions such as resuming uploads from breakpoints and segmented uploads. TCP: maintain long connections, ensure the real-time nature of messages, and correspond to data transmission protocols. Purpose: Send and receive messages in time. Thinking comprehensively, use http and tcp. What data communication protocol to choose? The principle of IM protocol selection is generally: easy to expand, convenient to cover various business logics, and save traffic at the same time. The need to save traffic is especially important on mobile IM. xmpp The protocol is open source, highly expandable, and has various languages at each end (including the server) The realization of ,…