1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Merge pull request #218 from fuentesj11/update-documentation

Update/Edit connections.md
This commit is contained in:
Florian Schmaus 2018-04-03 07:45:27 +02:00 committed by GitHub
commit 22b8f29d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,11 +6,10 @@ Smack: XMPPConnection Management
Creating a Connection Creating a Connection
--------------------- ---------------------
The `org.jivesoftware.smack.XMPPConnection` class manages your connection to The `org.jivesoftware.smack.XMPPConnection` interface manages your connection to
an XMPP server. The default implementation is the an XMPP server. The default implementation is the
`org.jivesoftware.smack.XMPPTCPConnection` class. Two constructors are mainly `org.jivesoftware.smack.tcp.XMPPTCPConnection` class. The class contains three constructors. The simplest, `XMPPTCPConnection(CharSequence, String, String)` takes the username, password, and server name you'd like
used. The first, `XMPPTCPConnection(String)` takes the server name you'd like to connect to as arguments. All default connection settings will be used:
to connect to as an argument. All default connection settings will be used:
* A DNS SRV lookup will be performed to find the exact address and port (typically 5222) that the server resides at. * 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 maximum security possible will be negotiated with the server, including TLS encryption, but the connection will fall back to lower security settings if necessary.
@ -47,12 +46,11 @@ connection.disconnect();
``` ```
By default Smack will try to reconnect the connection in case it was abruptly By default Smack will try to reconnect the connection in case it was abruptly
disconnected. Use _ConnectionConfiguration#setReconnectionAllowed(boolean) to disconnected. The reconnection manager will try to immediately
turn on/off this feature. The reconnection manager will try to immediately
reconnect to the server and increase the delay between attempts as successive reconnect to the server and increase the delay between attempts as successive
reconnections keep failing._ reconnections keep failing._
In case you want to force a reconnection while the reconnetion manager is In case you want to force a reconnection while the reconnection manager is
waiting for the next reconnection, you can just use _AbstractXMPPConnection#connect()_ waiting for the next reconnection, you can just use _AbstractXMPPConnection#connect()_
and a new attempt will be made. If the manual attempt also failed then the and a new attempt will be made. If the manual attempt also failed then the
reconnection manager will still continue the reconnection job. reconnection manager will still continue the reconnection job.