forked from igniterealtime/Smack
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ibb] Ensure InBandBytestreamManager is a singleton
InBandBytestreamManager followed an unusual pattern: Within the connectionTermianted() callback, it would remove itself from the 'managers' map. This allowed for multiple instances of an InBandBytestreamManager to exist for the same connection, causing all kinds of issues. This fixes the issue by changing InBandBytestreamManager to use the Smack-idiomatic pattern used by managers. We also do no longer reset the listeners if the connection is termianted, as listeners (and handlers) typically persist until they are explicitly removed by the user. As positive side-effect, the number of indeterministic unit-tests, caused by using Thread.sleep(), is reduced. The executor service in InitiationListener was also removed, because the IQ handler is already called asynchronously to the connections main loop. Thanks to Anno van Vliet for reporting this.
- Loading branch information
Showing
3 changed files
with
41 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters