mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02: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>
|
||||
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>
|
||||
class. Two constructors are mainly used. The first, <tt>XMPPConnection(String)</tt> takes
|
||||
server. The default implementation is the <tt>org.jivesoftware.smack.XMPPTCPConnection</tt>
|
||||
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
|
||||
be used:
|
||||
<ul>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<li>The XMPP resource name "Smack" will be used for the connection.</li>
|
||||
</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:
|
||||
|
||||
<ul>
|
||||
|
@ -63,7 +63,7 @@ ConnectionConfiguration config = new ConnectionConfiguration(<font color="green"
|
|||
config.setCompressionEnabled(true);
|
||||
config.setSASLAuthenticationEnabled(true);
|
||||
|
||||
Connection connection = new XMPPConnection(config);
|
||||
XMPPConnection connection = new XMPPTCPConnection(config);
|
||||
<font color="gray"><i>// Connect to the server</i></font>
|
||||
connection.connect();
|
||||
<font color="gray"><i>// Log into the server</i></font>
|
||||
|
|
|
@ -76,18 +76,18 @@ list of initializers.
|
|||
Establishing a Connection
|
||||
</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>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
<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();
|
||||
|
||||
<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);
|
||||
Connection conn2 = <font color="navy"><b>new</b></font> XMPPConnection(config);
|
||||
XMPPConnection conn2 = <font color="navy"><b>new</b></font> XMPPTCPConnection(config);
|
||||
conn2.connect();
|
||||
</pre></div>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Smack Key Advantages
|
|||
can be accomplished in only a few lines of code:
|
||||
|
||||
<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.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() {
|
||||
|
|
Loading…
Reference in a new issue