Revision c23c992f

View differences:

mininet/net.py
149 149
        self.numCores = numCores()
150 150
        self.nextCore = 0  # next core for pinning hosts to CPUs
151 151
        self.listenPort = listenPort
152
        self.waitConn = waitConnected
152 153

  
153 154
        self.hosts = []
154 155
        self.switches = []
......
164 165
        if topo and build:
165 166
            self.build()
166 167

  
167
        if waitConnected:
168
            self.waitConnected()
169 168

  
170 169
    def waitConnected( self, timeout=None ):
171 170
        """wait for each switch to connect to a controller,
......
180 179
            for switch in remaining:
181 180
                if not switch.connected():
182 181
                    connected = False
183
                    sleep( .5 )
184
                    time += .5
185 182
                else:
186 183
                    remaining.remove( switch )
187 184
            if connected:
188 185
                break
186
            sleep( .5 )
187
            time += .5
189 188
        if time >= timeout and timeout is not  None:
190 189
            warn( 'Timed out after %d seconds\n' % time )
191 190
            for switch in self.switches:
......
432 431
            info( switch.name + ' ')
433 432
            switch.start( self.controllers )
434 433
        info( '\n' )
434
        if self.waitConn:
435
            self.waitConnected()
435 436

  
436 437
    def stop( self ):
437 438
        "Stop the controller(s), switches and hosts"

Also available in: Unified diff