525ee09ea1
Do net put an ack to the queue if it has already been shutdown. Some servers, like ejabberd, like to request an ack even after we have send a stream close (and hance the queue was shutdown). If we would not check here, then the ack would dangle around in the queue, and be send on the next re-connection attempt even before the stream open. See the following trace of the MUC bookmarks integration test. The fact that it is a MUC test does not matter, but this test does disconnect the connection and reconnect it. Not how the server, ejabberd in this case, requests an SM ack by sending an <r/> even though we already send the </stream:stream>: 22:22:05 SENT (4): <iq id='MD4UC-61' type='set'> <query xmlns='jabber:iq:private'> <storage xmlns='storage:bookmarks'> <conference name='Smack Inttest: 7in7j' autojoin='true' jid='y9jcn5@conference.salem.geekplace.eu'> <nick> Nick-P2VXD7 </nick> </conference> </storage> </query> </iq> 22:22:05 RECV (4): <r xmlns='urn:xmpp:sm:3'/> 22:22:05 SENT (4): <a xmlns='urn:xmpp:sm:3' h='29'/> 22:22:05 RECV (4): <message to='sinttest-7in7j-4@salem.geekplace.eu' from='sinttest-7in7j-4@salem.geekplace.eu' type='headline'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='storage:bookmarks'> <item id='current'> <storage xmlns='storage:bookmarks'> <conference name='Smack Inttest: 7in7j' autojoin='true' jid='y9jcn5@conference.salem.geekplace.eu'> <nick> Nick-P2VXD7 </nick> </conference> </storage> </item> </items> </event> <addresses xmlns='http://jabber.org/protocol/address'> <address jid='sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090' type='replyto'/> </addresses> </message> 22:22:05 RECV (4): <iq xml:lang='en-US' to='sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090' from='sinttest-7in7j-4@salem.geekplace.eu' type='result' id='MD4UC-61'/> 22:22:05 SENT (4): <presence id='6MS6J-20' type='unavailable'/> <a xmlns='urn:xmpp:sm:3' h='31'/> <!-- We have closed the stream --> </stream:stream> <!-- But the server still requests an SM ack --> 22:22:05 RECV (4): <r xmlns='urn:xmpp:sm:3'/> 22:22:05 RECV (4): </stream:stream> 22:22:05 XMPPConnection closed (XMPPTCPConnection[sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090] (4)) 22:22:05 SENT (4): <a xmlns='urn:xmpp:sm:3' h='31'/> 22:22:05 SENT (4): <stream:stream xmlns='jabber:client' to='salem.geekplace.eu' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='sinttest-7in7j-4@salem.geekplace.eu' xml:lang='en-US'> 22:22:05 RECV (4): ?xml version='1.0'?> <stream:stream id='3379123514446782311' ver 22:22:05 RECV (4): sion='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'> <stream:error> <invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> </stream:error> </stream:stream> 22:22:05 XMPPConnection closed due to an exception (XMPPTCPConnection[sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090] (4)) org.jivesoftware.smack.XMPPException$StreamErrorException: invalid-xml You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions <stream:error><invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error> at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:981) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:913) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:936) at java.base/java.lang.Thread.run(Thread.java:834) |
||
---|---|---|
.github | ||
config | ||
documentation | ||
resources | ||
smack-android | ||
smack-android-extensions | ||
smack-bosh | ||
smack-core | ||
smack-debug | ||
smack-debug-slf4j | ||
smack-experimental | ||
smack-extensions | ||
smack-im | ||
smack-integration-test | ||
smack-java7 | ||
smack-java8-full | ||
smack-jingle-old | ||
smack-legacy | ||
smack-omemo | ||
smack-omemo-signal | ||
smack-omemo-signal-integration-test | ||
smack-openpgp | ||
smack-repl | ||
smack-resolver-dnsjava | ||
smack-resolver-javax | ||
smack-resolver-minidns | ||
smack-resolver-minidns-dox | ||
smack-sasl-javax | ||
smack-sasl-provided | ||
smack-streammanagement | ||
smack-tcp | ||
smack-xmlparser | ||
smack-xmlparser-stax | ||
smack-xmlparser-xpp3 | ||
.gitignore | ||
.travis.yml | ||
build.gradle | ||
LICENSE | ||
README.md | ||
repl | ||
settings.gradle | ||
version |
Smack
About
Smack is an open source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android.
A pure Java library, it can be embedded into your applications to create anything from a full XMPP instant messaging client to simple XMPP integrations such as sending notification messages and presence-enabling devices. Smack and XMPP allows you to easily exchange data, in various ways e.g. fire-and-forget, publish-subscribe, between human and non-human endpoints (M2M, IoT, …).
More information are provided by the Overview.
Getting started
Start with having a look at the Documentation and the Javadoc.
Instructions on how to use Smack in your Java or Android project are provided in the Smack Readme and Upgrade Guide.
Professional Services
Smack is a collaborative effort of many open source, professionally and spare-time, paid and unpaid, contributors. While we try to provide the best possible XMPP library for Android and Java SE compatible execution environments by following state of the art software engineering practices, the API may not always perfectly fit your requirements. We welcome contributions and encourage discussion about how Smack can be further improved. We also provide paid services ranging from XMPP/Smack related consulting to designing and developing features in order to accommodate your needs. Please contact Florian Schmaus for further information.
Bug Reporting
Only a few users have access for filling bugs in the tracker. New users should:
- Read "How to ask for help or report an issue"
- Create a discourse account (you can also sign up with your Google account).
- Login to the forum account
- Press "New Topic" in your toolbar and choose the 'Smack Support' sub-category.
Please search for your issues in the bug tracker before reporting.
Donate
If you find Smack useful and feel like donating, then you can use one of the following systems:
- Donate via Bitcoin: 1LiU78z3498wu3jwRPKbvovKAHjTcpVbuK
Contact
The developers hang around in #smack
(freenode, IRC) and open_chat@conference.igniterealtime.org
(XMPP MUC room).
Remember that it may take some time (~hours) to get a response.
You can also reach us via the Smack Support Forum if you have questions or need support, or the Smack Developers Forum if you want to discuss Smack development.
Contributing
If you want to start developing for Smack and eventually contribute code back, then please have a look at the Guidelines for Smack Developers and Contributors. The guidelines also contain development quickstart instructions.
Resources
- Current Readme: https://igniterealtime.org/projects/smack/readme
- Bug Tracker: https://issues.igniterealtime.org/browse/SMACK
- JaCoCo Coverage Reports: https://www.igniterealtime.org/builds/smack/dailybuilds/jacoco/html/
- Nightly Javadoc: http://www.igniterealtime.org/builds/smack/dailybuilds/javadoc/
- Nightly Documentation: http://www.igniterealtime.org/builds/smack/dailybuilds/documentation/
- User Forum: https://discourse.igniterealtime.org/c/smack/smack-support
- Dev Forum: https://discourse.igniterealtime.org/c/smack/smack-dev
- Maven Releases: https://oss.sonatype.org/content/repositories/releases/org/igniterealtime/smack/
- Maven Snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/igniterealtime/smack/
- Nightly Unique Maven Snapshots: https://igniterealtime.org/repo/
Ignite Realtime
Ignite Realtime is an Open Source community composed of end-users and developers around the world who are interested in applying innovative, open-standards-based RealTime Collaboration to their businesses and organizations. We're aimed at disrupting proprietary, non-open standards-based systems and invite you to participate in what's already one of the biggest and most active Open Source communities.
Smack - an Ignite Realtime community project.