As you probably realized by now, I’‘m working on making Smack better behaved in multi-threaded/server environments. I’‘m no Jabber wizard, most of what I know about it I learned using Smack, and I’‘m not even a Smack expert (nor close!), but I’'m eager to receive comments, questions and tips on this regard.
This patch is pretty simple, but it allows you to get the roster once it’'s been loaded and not have to block. As a bonus, using this method never gives you a null roster, in opposition to XMPPConnection.getRoster on slow connections (where loading the roster might take more than the 2 seconds blocking limit).
My server-side application pushes the roster to the user upon log-in (and subsequent modifications), so this simple modification reduced the log-in time to about a fifth. As usual, your milleage might vary.
smack-1.4.1-jkohen-rosterlistener.patch (1884 Bytes)