15.5. Running the Main Loop

In order to run the simulation or offer services to other nodes the main loop must be started and entered. The loop can be entered only if the node has correctly connected to the simulation.

Call System::run() to enter the main loop. The Core will loop in the method until quit from the loop is requested or a non-application exception is raised. Note that the Core cancels pending operations (for example SRPC calls) if a quit from the loop was requested. Thus, the simulation state can be affected by the quit (i.e. the state prior to a call to System::request_quit() can differ from the state after the quit has been actually performed).

[Note]Note

This is not a problem unless the main loop is reentered again and the simulation restarted without a reconnect.

[Warning]Warning

Managed exceptions uncaught by the application will not stop the simulation. They are simply ignored.