예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
    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()
예제 #4
0
 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()