hello-world.rb
| 1 |
defGroup('Sender', "omf.nicta.node36") do |node| |
|---|---|
| 2 |
node.addApplication("test:app:otg2") do |app| |
| 3 |
app.setProperty('udp:local_host', '192.168.0.2') |
| 4 |
app.setProperty('udp:dst_host', '192.168.0.3') |
| 5 |
app.setProperty('udp:dst_port', 3000) |
| 6 |
app.measure('udp_out', :samples => 1) |
| 7 |
end
|
| 8 |
node.net.e0.ip = "192.168.0.2"
|
| 9 |
end
|
| 10 |
|
| 11 |
defGroup('Receiver', "omf.nicta.node37") do |node| |
| 12 |
node.addApplication("test:app:otr2") do |app| |
| 13 |
app.setProperty('udp:local_host', '192.168.0.3') |
| 14 |
app.setProperty('udp:local_port', 3000) |
| 15 |
app.measure('udp_in', :samples => 1) |
| 16 |
end
|
| 17 |
node.net.e0.ip = "192.168.0.3"
|
| 18 |
end
|
| 19 |
|
| 20 |
onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 21 |
info "This is my first OMF experiment"
|
| 22 |
wait 10
|
| 23 |
allGroups.startApplications |
| 24 |
info "All my Applications are started now..."
|
| 25 |
wait 30
|
| 26 |
allGroups.stopApplications |
| 27 |
info "All my Applications are stopped now."
|
| 28 |
Experiment.done
|
| 29 |
end
|