Implementation of bottom-layer instant messaging with XMPP protocol (I) -- xmpprfc6121 since RFC6121 reading
Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presenceok, erruiba, it's time to read RFC6121. Before reading this article, I hope that you can communicate with your leader in time. In this article, I will introduce RFC6121 and share some of the reading skills that I summarized at the time (not to mention it ).
Before reading each protocol, please calm down and read this most important Abstract. Yes, make sure you understand the meaning of each word in its content, because this summative statement is indeed very important. Only by truly understanding the content of the agreement can you know whether the agreement has been applied to your project (mom, don't you talk nonsense, I don't need to watch it ). When I took my team, the partners who started with me often had A detour. They always wasted too much time on Protocol B involved in the protocol, in fact, we only need to use Protocol A. Some details must be supported by Protocol B (for example, query, custom XML section, naming rules ,...). If you want to read these similar B protocols, you will not be able to learn anything this day. On this day, you are all confused. You do not know the key points of the problem and the efficiency is low.
Okay. Don't put too much pressure on it. Relax and take a deep breath.
1. introduction
Except for the history section, you can read other chapters carefully. Here we need to understand several keywords:. what is language XML and XMPP-Core? Why does XML namespace need this? B. What functions does one IM need? (Read section 1.3 carefully, because these are what we will build and write.) Why is section c. 1.4 used?
Is it a bit difficult to learn? Go out and smoke a cigarette. Take a rest and try again.
The following are the difficulties and highlights. I hope you can continue reading with three questions. 1) <iq> what is it, <p> what is it, and <message> what is it? 2). xmlns = 'jabber: iq: roster' what is it? 3) What does bareJid mean? How to define
Please respect the copyright of the author. I am very tired of typing. for reprinting, please sign the source: the original article portal.
2. do not worry about Roster. You only need to understand what roster is and what functions it has (when you look at it, learn about the approximate XML tag format and do not recite it, as long as you can understand a little ). How to define some new and commonly used label variables. Just like reading a book on a programming language, the new skill cannot be mastered, but we can refer to the book for coding when doing a project, then, practices will be applied to future projects and skill get. oh, yeah! Baby!
3. Presence is similar to roster, label definition,
4. The Message is similar to the roster label definition.
Some subsequent chapters are actually not very useful. You can skip the content, but you must know the contents. What is this. Because during the project, you may need to refer to the protocol to modify the code again.
OK, it's time for me to summarize. After reading these three sections, I think everyone must be confused... Well, that's why I came here.
There are three types of message notifications in XMPP: iq message <iq> </iq>, most of which are used for client-to-server interaction. For example, if the XX attribute is set, whether a message is successfully subscribed to, whether an XML section is sent, and whether the server receives the message normally.
Presence messages <p> </p> are used for display of most attendance messages. For example, when a person successfully subscribes to a message, you will receive the message <p> from this person. How can we understand it? Well, attendance, friends in roster, and pubsub subscription will be used.
Message is the most custom message format. If you want to transmit custom data, it should be enough. Where used: interaction between people, interaction between the server and you (XXX left a message for you, XXX released a new dynamic), interaction between you and the server (message sent by XXX, I have already received this message. The server will help me record it and tell XXX ).
1). <iq> what is it, <p> what is it, <message> what is it? I have already mentioned some things. 2) What is xmlns = 'jabber: iq: roster? Your answer3) What does bareJid mean? How to define your answer
Ask yourself to solve the problem. Do you understand homework? I am too tired to beat my hand, or copy and paste it easily. Second (second) Second
If you are not quite familiar with this... Well, it doesn't matter if you don't understand this, but at least you know it's probably right? If you do not even know about a connection, for example, what is jid, <iq>, <p>, <message>, or roster, okay... Big Brother, check it out again... I don't know how to continue reading it. I also gave back the definition of the concept...
Panic !~ Don't worry about writing code... Sao Nian, you are a beginner. Although you cannot write a code with a valid function, I still want to congratulate you. At least you are getting started.
Btw1: Please back the tableContent directory of RFC6121 to make it a good habit. The directory of each protocol should be roughly recited and you will know what the title is about. Btw2: Go to gitHub to download the IOS version of the underlying framework XMPPFramework. Android friends download smack (which seems to be spelling like this... Forget, Android kids shoes solve it by yourself.) btw3: I will discuss with other colleagues about the lack of understanding of a person. The team should reach a consensus. Otherwise, it will be difficult to write code at that time... Btw4: next release notice <IOS XMPPFramework -- Introduction, how to use this product? Slot, and bugs that the author cannot solve. WTF> btw5: manager. I will start building a project tomorrow. I am so excited... Let me take a day to read this silly blog. I will start writing it tomorrow, really.