I was thinking that maybe the packet listeners and keep alive threads can be shared among connections. Doing AwfulMath TM tells me that scalability would be improved by a factor of 3/5 if it were possible (that is 3 threads less per connection out of 5). In other words, Smack would create 2 threads per connection plus 2 additional threads (one packet listener and the keep alive task).
This doesn’‘t require dealing with non-blocking I/O, so the API won’‘t need to be changed. Anybody gave this a thought and found out it couldn’'t be done, or maybe I should give it a try?
P.S.: I found a related post here (http://www.jivesoftware.org/forums/thread.jspa?threadID=12711), but it’'s been archived, so I started a new one.