Sometimes for a very large installations you may want to set larger number of s2s connections to remote servers. Especially if they work in cluster of several nodes. In such a case you can also have a control over XMPP packets distribution among s2s connections to a single remote server.
This piece of code is pluggable and you can write your own connection selector. It is enough to implement 'S2SConnectionSelector' interface and set your class name in the configuration using following parameter in init.properties file:
The default selector picks connections randomly.