proc ApplyTraffic {} { puts "\nApplying configuration to hardware ..." set traffic [ixNet getRoot]traffic set stopCounter 10 for {set startCounter 1} {$startCounter <= $stopCounter} {incr startCounter} { catch {ixNet exec apply $traffic} errMsg if {$errMsg != "::ixNet::OK" && $startCounter < $stopCounter} { puts "ApplyTraffic warning: Attempting to apply traffic: $startCounter/$stopCounter tries" after 1000 continue } if {$errMsg != "::ixNet::OK" && $startCounter == $stopCounter} { puts "ApplyTraffic error: $errMsg" exit } if {$errMsg == "::ixNet::OK" && $startCounter < $stopCounter} { puts "Successfully applied traffic to hardware" break } } after 2000 }