Handles the communication between the server and the simulator.