The org.jivesoftware.smack.XMPPConnection class manages your connection to an XMPP
server. Two constructors are available. The first, XMPPConnection(String) takes
the server name you'd like to connect to as an argument. All default connection settings will
Alternatively, you can use the XMPPServer(ConnectionConfiguration) constructor to
specify advanced connection settings. Some of these settings include:
- A DNS SRV lookup will be performed to find the exact address and port (typically 5222)
that the server resides at.
- The maximum security possible will be negotiated with the server, including TLS encryption,
but the connection will fall back to lower security settings if necessary.
- The XMPP resource name "Smack" will be used for the connection.
- Manually specify the server address and port of the server rather than using a DNS SRV
- Enable connection compression.
- Customize security settings, such as flagging the connection to require TLS encryption
in order to connect.
- Specify a custom connection resource name such as "Work" or "Home". Every connection
by a user to a server must have a unique resource name. For the user "email@example.com", the
full address with resource might be "firstname.lastname@example.org/Smack". With unique resource names, a user
can be logged into the server from multiple locations at once, or using multiple devices. The
presence priority value used with each resource will determine which particular connection
receives messages to the bare address ("email@example.com" in our example).