mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Fix documentation to use correct XMPPConnection names
Some parts of the documentation still refer to Connection connection = new XMPPConnection(…) when it should be XMPPConnection connection = new XMPPTCPConnection(…) SMACK-574
This commit is contained in:
parent
1de2da8ec4
commit
3d926a034c
3 changed files with 8 additions and 8 deletions
|
@ -20,8 +20,8 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <tt>org.jivesoftware.smack.XMPPConnection</tt> class manages your connection to an XMPP
|
The <tt>org.jivesoftware.smack.XMPPConnection</tt> class manages your connection to an XMPP
|
||||||
server. The default implementation is the <tt>org.jivesoftware.smack.XMPPConnection</tt>
|
server. The default implementation is the <tt>org.jivesoftware.smack.XMPPTCPConnection</tt>
|
||||||
class. Two constructors are mainly used. The first, <tt>XMPPConnection(String)</tt> takes
|
class. Two constructors are mainly used. The first, <tt>XMPPTCPConnection(String)</tt> takes
|
||||||
the server name you'd like to connect to as an argument. All default connection settings will
|
the server name you'd like to connect to as an argument. All default connection settings will
|
||||||
be used:
|
be used:
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<li>The XMPP resource name "Smack" will be used for the connection.</li>
|
<li>The XMPP resource name "Smack" will be used for the connection.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Alternatively, you can use the <tt>XMPPServer(ConnectionConfiguration)</tt> constructor to
|
Alternatively, you can use the <tt>XMPPTCPConnection(ConnectionConfiguration)</tt> constructor to
|
||||||
specify advanced connection settings. Some of these settings include:
|
specify advanced connection settings. Some of these settings include:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -63,7 +63,7 @@ ConnectionConfiguration config = new ConnectionConfiguration(<font color="green"
|
||||||
config.setCompressionEnabled(true);
|
config.setCompressionEnabled(true);
|
||||||
config.setSASLAuthenticationEnabled(true);
|
config.setSASLAuthenticationEnabled(true);
|
||||||
|
|
||||||
Connection connection = new XMPPConnection(config);
|
XMPPConnection connection = new XMPPTCPConnection(config);
|
||||||
<font color="gray"><i>// Connect to the server</i></font>
|
<font color="gray"><i>// Connect to the server</i></font>
|
||||||
connection.connect();
|
connection.connect();
|
||||||
<font color="gray"><i>// Log into the server</i></font>
|
<font color="gray"><i>// Log into the server</i></font>
|
||||||
|
|
|
@ -76,18 +76,18 @@ list of initializers.
|
||||||
Establishing a Connection
|
Establishing a Connection
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
The <tt>XMPPConnection</tt> class is used to create a connection to an
|
The <tt>XMPPTCPConnection</tt> class is used to create a connection to an
|
||||||
XMPP server. Below are code examples for making a connection:<p>
|
XMPP server. Below are code examples for making a connection:<p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
<font color="gray"><i>// Create a connection to the jabber.org server.</i></font>
|
<font color="gray"><i>// Create a connection to the jabber.org server.</i></font>
|
||||||
Connection conn1 = <font color="navy"><b>new</b></font> XMPPConnection(<font color="green">"jabber.org"</font>);
|
XMPPConnection conn1 = <font color="navy"><b>new</b></font> XMPPTCPConnection(<font color="green">"jabber.org"</font>);
|
||||||
conn1.connect();
|
conn1.connect();
|
||||||
|
|
||||||
<font color="gray"><i>// Create a connection to the jabber.org server on a specific port.</i></font>
|
<font color="gray"><i>// Create a connection to the jabber.org server on a specific port.</i></font>
|
||||||
ConnectionConfiguration config = new ConnectionConfiguration(<font color="green">"jabber.org"</font>, 5222);
|
ConnectionConfiguration config = new ConnectionConfiguration(<font color="green">"jabber.org"</font>, 5222);
|
||||||
Connection conn2 = <font color="navy"><b>new</b></font> XMPPConnection(config);
|
XMPPConnection conn2 = <font color="navy"><b>new</b></font> XMPPTCPConnection(config);
|
||||||
conn2.connect();
|
conn2.connect();
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ Smack Key Advantages
|
||||||
can be accomplished in only a few lines of code:
|
can be accomplished in only a few lines of code:
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
Connection connection = <font color="navy"><b>new</b></font> XMPPConnection(<font color="green">"jabber.org"</font>);
|
XMPPConnection connection = <font color="navy"><b>new</b></font> XMPPTCPConnection(<font color="green">"jabber.org"</font>);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
connection.login(<font color="green">"mtucker"</font>, <font color="green">"password"</font>);
|
connection.login(<font color="green">"mtucker"</font>, <font color="green">"password"</font>);
|
||||||
Chat chat = connection.getChatManager().createChat(<font color="green">"jsmith@jivesoftware.com"</font>, new MessageListener() {
|
Chat chat = connection.getChatManager().createChat(<font color="green">"jsmith@jivesoftware.com"</font>, new MessageListener() {
|
||||||
|
|
Loading…
Reference in a new issue