public void setRequiredServices ( long requiredServices ) { lock . lock ( ) ; try { this . requiredServices = requiredServices ; peerDiscoverers . clear ( ) ; addPeerDiscovery ( MultiplexingDiscovery . forServices ( params , requiredServices ) ) ; } finally { lock . unlock ( ) ; } }
Convenience for connecting only to peers that can serve specific services . It will configure suitable peer discoveries .