All of the following is based on your own memory and understanding, if there is an incorrect or even fallacy, please forgive me.
1, what is XMPP?
The predecessor of XMPP is a network instant communication protocol generated by Jabber, an open source form. XMPP is currently organized by IETF International Standards. Standardized core results are divided into two parts;
Core XML Flow Transportation Agreement
Instant messaging extension application based on XML stream
The definition of XMPP's core XML streaming protocol enables XMPP to be more specific to past network communication protocols. With the characteristics of XML easy to analyze and read, the XMPP protocol can be very beautiful.
XMPP's instant messaging extension application part is an abstract definition of instant messaging based on IETF, and other instant messaging protocols, such as AIM, QQ, etc., which have been widely used, such as AIM, QQ, etc. according to IETF.
2, what is the basic network structure of XMPP?
Three characters, clients, servers, gateways are defined in XMPP. Communication can happen between any two of these three. The server also undertakes the routing function of client information record, connection management, and information. The gateway assumes the interconnection of the heterogeneous instant communication system, and the heterogeneous system can include SMS (SMS), MSN, ICQ, etc. The basic network form is a single client to connect to a single server via TCP / IP and then transmit XML over.
3, what is the XMPP passing through TCP?
Transferring instructions related to instant messaging. In the previous command, (for example, qq) is sent in the form of 2, either to send (such as MSN) with a plain text instruction to add a line-in. The logic of the instant messaging instruction transmitted by XMPP transmission is similar to the previous protocol, which has become plain text in the XML format. This is not only easy to analyze, but people are easy to read, which is convenient for development and check. The core part of XMPP is a stream protocol that sends an XML on the network. This stream protocol is the basis of the XMPP's instant messaging command, is also a very important network base protocol that can be further utilized. Therefore, it can be said that XMPP is transmitted by TCP is an XML stream.
4. For example, see what the so-called XML stream looks like.
Client: XML Version = '1.0'?>
TO = 'example.com' XMLns = 'Jabber: Client' XMLns: stream = 'http: //etherx.jabber.org/streams' Version = '1.0'> Server: XML Version = '1.0'?> From = 'example.com' ID = 'someID' XMLns = 'Jabber: Client' XMLns: stream = 'http: //etherx.jabber.org/streams' Version = '1.0'> ... other communication ... Client: To='Romeo@example.net ' XML: lang = 'en'> Client: Client: message> server: To='juliet@example.com ' XML: lang = 'en'> Server: Server: message> Client: stream: stream> Server: stream: stream> From the point of view of the document, all XML text sent by the client or server conforms together from