mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Renamed Connection to XMPPConnection
This commit is contained in:
parent
f3e007bad5
commit
489816c61f
145 changed files with 639 additions and 641 deletions
|
@ -27,7 +27,7 @@ A packet listener is used for event style programming, while a packet collector
|
|||
result queue of packets that you can do polling and blocking operations on. So, a packet
|
||||
listener is useful when you want to take some action whenever a packet happens to come in,
|
||||
while a packet collector is useful when you want to wait for a specific packet to
|
||||
arrive. Packet collectors and listeners can be created using an <tt>Connection</tt> instance.<p>
|
||||
arrive. Packet collectors and listeners can be created using an <tt>XMPPConnection</tt> instance.<p>
|
||||
|
||||
The <tt>org.jivesoftware.smack.filter.PacketFilter</tt> interface determines which
|
||||
specific packets will be delivered to a <tt>PacketCollector</tt> or <tt>PacketListener</tt>.
|
||||
|
@ -42,7 +42,7 @@ listener:<p>
|
|||
<font color="gray"><i>// user. We use an AndFilter to combine two other filters.</i></font>
|
||||
PacketFilter filter = new AndFilter(new PacketTypeFilter(<b>Message.class</b>),
|
||||
new FromContainsFilter(<font color="green">"mary@jivesoftware.com"</font>));
|
||||
<font color="gray"><i>// Assume we've created a Connection name "connection".</i></font>
|
||||
<font color="gray"><i>// Assume we've created a XMPPConnection name "connection".</i></font>
|
||||
|
||||
<font color="gray"><i>// First, register a packet collector using the filter we created.</i></font>
|
||||
PacketCollector myCollector = connection.createPacketCollector(filter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue