Recently looked at the framework for XMPP, as an example of text chat, the message that needs to be sent is:Kizhong from is the message from which user, to is sent to who, the user of XMPP is in the form of a mailbox. Body is the text of the message we send.Well, in this case, we will develop an XMPP-based iOS chat client program, first we need
Objectivehttp://blog.csdn.net/shimiso/article/details/8816558The Java field of Instant Messaging solutions can be considered openfire+spark+smack. There are other options, of course.OpenFire is an Instant Messaging server-side version that is based on the Jabber Protocol (XMPP), which is currently recommended to use the 3.8.1 version, which is currently the latest version and can be found on the web for dow
Xmpp notes: user network connection and friend management, xmpp network connection
In xmppUser connection moduleIncluding display of user online and offline information, user logon, and user registration;Friend ModuleIncluding adding friends, deleting friends, and displaying friends lists.
XmppStream is the class responsible for data transmission in xmpp. during
XMPP client development (1), xmpp client development
Smack can be used for XMPP client development. After downloading Smack and importing relevant jar files, you can start XMPP client development.
The following code connects the client to the Tigase server and logs on to the server based on the user name and password.
I recently read about the XMPP framework. Taking text chat as an example, the message to be sent is:
[HTML]View
Plaincopy
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 the message text we send.
Now, let's develop an iOS chat client program based on XMPP. First, we
Just take a look at the import steps for XMPP-related frameworks for easy viewing laterI. Framework Address1.
xmppframework
frame address available in other languageshttp://xmpp.org/xmpp-software/libraries/2. Download the Xmppframework framework:Https://github.com/robbiehanson/XMPPFramework3.git CloneHttps://github.com/robbiehanson/XMPPFramework.gitTwo. Import the relevant framework
Cocoa
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
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 login to register a friend group _ practical tutorial 4, xmpp login Registration
// Obtain the status of friends-online or offline. Just write it for judgment and return.
. H
1 /*! 2 * @Author Dylan. 3 * 4 * Paresence 5 */ 6 typedef void (^userGoOnline) (NSString *); 7 typedef void (^userGoOffline) (NSString *); 8 9 - (void)refreshRosterPresence: (userGoOnline)online10 off
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 "
pushed to the [email protected] Client. Where the From property of Can be used to indicate the state of a user, such as a change in user status to "Do Not Disturb" ("Don't Disturb"), which is sent to the server:IQ is info/query, using the "request-response" mechanism, similar to the HTTP mechanism. The following example is where the client obtains a contact through Client requests to get contacts:Server results returned:To build an XMPP server:Before
the Android platform. The client initiates a connection creation request to the server during the communication initialization and instant communication. The system establishes a connection with the Internet through the GPRS wireless network, and implements instant communication with the android client through the server.
Server:
The server uses openfire as the server. Allows multiple clients to log on simultaneously and concurrently connect to a server. The server authenticates the connection
COE (public operating environment), in the U.S. Military FBS (future Combat Systems provides services to provide chat services and to receive battlefield information from sensors, allowing real-time information to be transmitted between individual combat platforms, sensors and other resources.At the same time, due to the Jabber cross-platform features, IP phones and handheld devices that support Jabber have emerged, and there are reports that companies have developed subscription/distribution p
I. Overview of the SMACK LibrarySmack is an open-source, easy-to-use Xmpp/jabber client library that is developed in the Java language and developed by Jive Software.The advantage of smack is that programming is simple.Smack's disadvantage is that its API is not designed for a large number of concurrent users, each customer needs 1 threads, occupy a relatively high resource, so when using smack for simulati
of properties for each message, which can also contain Java objects.3) Open source code based on Apache license, which means you can put smack into your own business software.Iv. composition of the Smack libraryThe smack library can be embedded into any Java application. The Smack library is composed of several jar files and is very flexible.1, Smack-core.jarProvides the core
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.