Build an XMPP environment and build an xmpp EnvironmentXMPP Environment Construction
1> several auxiliary tools are required to build an XMPP environment:
Java
Openfire is developed in Java, so we need to install the Java environment first.
XAMPP
XAMPP (Apache + MySQL + PHP + PERL) is a powerful software package for building XAMPP software stations
XMPP series (3) --- get friends list, add friends, and xmpp friends list
1. Heartbeat detection and disconnection Reconnection
Both the client and the server can set how often to send a heartbeat packet. If the other party does not return the correct pong information, the connection will be disconnected, and the reconnection function will be automatically added.
If you write your own chat function, you have
I recently read about the XMPP framework. Taking text chat as an example, the message to be sent is:
[HTML] View
Plaincopy
Message Type = "Chat" From = Kang@server.com" To = Test@server.com" >
Body > Helloword Body >
Message>
In the base, from is the message sent from the user, to is the message sent to the user, XMPP users are in the form of mailbox. Body is
JID:The address of an XMPP entity, called Jabber Identifier or Jid, acts like an IP address. A valid Jid includes the node name, domain name resource name, in the format: Jid=[node ' @ ']domain['/' resource]Namespace for XMPP protocol:Jabber:iq:private-Private data storage for local user private settings, such as user notes.Jabber:iq:conference--General meetings for information sharing among multiple usersj
XMPP-IOS instant messaging development environment, xmpp-ios instant messaging1. Install MySQL
Sudo vi ~ /. Bash_profile
Enter I to enter the editing mode, and enter:
# mysqlalias mysql='/usr/local/mysql/bin/mysql'alias mysqladmin='/usr/local/mysql/bin/mysqladmin'# lsalias ls='ls -G'
Press ESC to exit the editing mode. Enter:
:wq
Save the modification content and exit and restart the terminal program.3. Mo
(@"Authenticate Error:%@", [[Error UserInfo] description]); }}OnlineImplementation -(void) Xmppstreamdidauthenticate: (xmppstream *) Sender Delegate methodAfter successful authentication, callback the methodThis method was called after authentication have successfully finished.If authentication fails for some reason, the xmppStream:didNotAuthenticate:method would be called instead.Create a new Xmpppresence object, type available, send!-(void) Xmppstreamdidauthenticate: (Xmppstream *) Sender {
[IOS XMPP] logon to iOS XMPP
1. We recommend setting up an instant chat server. You can use Baidu to set up the server. There are many detailed tutorials.
Openfire is easy to use and written in Java,
Ejabberd is a well-known open-source Erlang project written in Erlang,
2. start logging on
1. Create an XMPPStream object and add a delegate
Add delegate method-(void) addDelegate :( id) delegate delegateQueue
Android interview technical points: xmpp knowledge preparation Socket server termination, Android xmpp
The previous section has basically completed communication between the server and the client, but does not implement persistent connection communication. This section fixes the bug.
1. for client code writing, we need to enable a thread to wait for the server to send a message.
public void startServerRepl
XMPP and xmpp protocolsLogon and logout
# Import "AppDelegate. h "# import" XMPPFramework. h "/** log on to AppDelegate. initialize XMPPStream 2. connect to the server [upload a JID] 3. after successfully connecting to the service, send a password authorization 4. after successful authorization, send an "online" Message */@ interface AppDelegate () Openfire after login
Openfire after cancellation
# Import "
Mobile phone multi-terminal instant messaging solution based on XMPP protocol ..... .... ... .... ... ..... ..... ..... ..... ..... ..... ..... ..... ............... 1Directory .................................................................................................................... 2First, the development background .......................................................................................................... 31. International b
present, the Fat Penguin Company to occupy the overwhelming advantage of the domestic IM market nearly 80% share, and tightly grasp the low-end market, a large number of users, profitable. Other IM Microsoft MSN (WLM), NetEase Popo, Sina UC, TOM Skype, Google gtalk share is more tragic, there are Yahoo Instant Messenger, AIM, ICQ and rumors of Baidu im and Sohu search Q and some of the current is not known as the Xiaonei School pass, Lava-lava and so on, and so on, where in the domestic call on
The XMPP (Extensible Message Processing Field Protocol) is an Extensible Markup Language (XML) protocol that is used for instant messaging (IM) and on-line on-site detection. It facilitates quasi-instant operation between servers. This agreement may eventually allow Internet users to send instant messages to anyone else on the internet, even if their operating system and browsers are different.
In fact, XMPP
XMPP (Scalable Message Processing site protocol) is based on the Extensible Markup Language (XML) protocol, which is used for instant messaging (IM) and online on-site detection. It facilitates quasi-real-time operations between servers. This protocol may eventually allow Internet users to send instant messages to anyone else on the Internet, even if the operating system is different from the browser.
The predecessor of
1 Why ChooseXMPPProtocol In the IETF, the IM protocol is divided into four protocols, namely instant information and Presence Protocol (Instant Messaging and Presence Protocol, IMPP), presence and Instant Messaging Protocol (presence and Instant Messaging Protocol, PRIM), Session Initiation protocol for Instant Messaging and Presence Extensions (Session Initiation Protocol for Instant Messaging and Presence leveraging Extensions, Simple), as well as extensible Message Presence Protocol (
present, the Fat Penguin Company to occupy the overwhelming advantage of the domestic IM market nearly 80% share, and tightly grasp the low-end market, a large number of users, profitable. Other IM Microsoft MSN (WLM), NetEase Popo, Sina UC, TOM Skype, Google gtalk share is more tragic, there are Yahoo Instant Messenger, AIM, ICQ and rumors of Baidu im and Sohu search Q and some of the current is not known as the Xiaonei School pass, Lava-lava and so on, and so on, where in the domestic call on
XMPP (Scalable Message Processing site protocol) is based on the Extensible Markup Language (XML) protocol, which is used for instant messaging (IM) and online on-site detection. It facilitates quasi-real-time operations between servers. This protocol may eventually allow Internet users to send instant messages to anyone else on the Internet, even if the operating system is different from the browser.
The predecessor of
XMPP (Scalable Message Processing site protocol) is based on the Extensible Markup Language (XML) protocol, which is used for instant messaging (IM) and online field probing. It promotes quasi-real-time operations between servers. This protocol may eventually allow Internet users to send instant messages to others on the Internet, even if their operating systems are different from those in browsers.
The predecessor of
XMPP (Extensible Message Processing Field Protocol) is an Extensible Markup Language (XML)-based protocol that is used for instant messaging (IM) and on-line on-site probing. It facilitates the quasi-immediate operation between servers. The agreement may finally allow Internet users to send instant messages to anyone else on the internet, even if their operating systems and browsers are different.XMPP's predecessor was Jabber, an open source form of o
XMPP (Extensible Message Processing Field Protocol) is an Extensible Markup Language (XML)-based protocol that is used for instant messaging (IM) and on-line on-site probing. It facilitates the quasi-immediate operation between servers. The agreement may finally allow Internet users to send instant messages to anyone else on the internet, even if their operating systems and browsers are different.XMPP's predecessor was Jabber, an open source form of o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.