#NEWLINE# def set_connections( self , addresses ) : #NEWLINE# #INDENT# 'A convenience method to set the connected addresses. A connection will be made to any new address included in the ``addresses``\n       enumerable and any currently connected address not included in ``addresses`` will be disconnected. If an address in ``addresses``\n       is already connected, it will not be affected.\n    ' #NEWLINE# with self . __connection_lock : #NEWLINE# #INDENT# self . active_connections = set ( addresses ) #NEWLINE# self . __update_addresses ( )