def establishConnectionsAndBroadcastTopology(serverState, nodesArr): #try to establish secure connections to a server for node in nodesArr: server_state.establishInboundConnection(node, serverState) server_state.establishOutboundConnection(node) NetworkTopologyCache().remove() log.debug("starting broadcast!") topology = ServerToServerMessage.getNetworkTopology() ## #recalculate the network topology and broadcast it broadCastMessage = BroadcastMessage() broadCastMessage.updateNetworkTopology()
def establishConnectionsAndBroadcastTopology(serverState,nodesArr): #try to establish secure connections to a server for node in nodesArr: server_state.establishInboundConnection(node,serverState) server_state.establishOutboundConnection(node) NetworkTopologyCache().remove() log.debug("starting broadcast!") topology = ServerToServerMessage.getNetworkTopology() ## #recalculate the network topology and broadcast it broadCastMessage = BroadcastMessage() broadCastMessage.updateNetworkTopology()
def testBroadCastMessage(self): self.create5NodeNetwork() #this way we initialize the configs for a specific server which lets us test method calls as as specific server clientConf = ConnectionBundle(confdir=self.serverConfs[0], reload=True) serverConf = ServerConf(confdir=self.serverConfs[0], reload=True) broadCastMessage = BroadcastMessage() #logs should mention that we are setting elements to cache broadCastMessage.updateNetworkTopology() clientConf = ConnectionBundle(confdir=self.serverConfs[1], reload=True) serverConf = ServerConf(confdir=self.serverConfs[1], reload=True) #this should be brought from the cache(check in the logs) ServerToServerMessage.getNetworkTopology()
def testBroadCastMessage(self): self.create5NodeNetwork() #this way we initialize the configs for a specific server which lets us test method calls as as specific server clientConf = ConnectionBundle(confdir=self.serverConfs[0],reload=True) serverConf = ServerConf(confdir=self.serverConfs[0],reload=True) broadCastMessage = BroadcastMessage() #logs should mention that we are setting elements to cache broadCastMessage.updateNetworkTopology() clientConf = ConnectionBundle(confdir=self.serverConfs[1],reload=True) serverConf = ServerConf(confdir=self.serverConfs[1],reload=True) #this should be brought from the cache(check in the logs) ServerToServerMessage.getNetworkTopology()