#include "trick/MonteCarlo.hh" #include "trick/message_proto.h" #include "trick/message_type.h" #include "trick/tc_proto.h" /** * @par Detailed Design: * This function performs a non-blocking accept on the listening socket. */ void Trick::MonteCarlo::receive_results() { fd_set rfds; struct timeval select_time; struct timeval timeout_time = {5,0}; int max_socket; Trick::MonteSlave *curr_slave = NULL; unsigned int curr_slave_id; FD_ZERO(&rfds); select_time = timeout_time; // add data listen device FD_SET(data_listen_device.socket, &rfds); max_socket = data_listen_device.socket; // add status listen device FD_SET(listen_device.socket, &rfds); if (max_socket < listen_device.socket) { max_socket = listen_device.socket; } select(max_socket + 1, &rfds, NULL, NULL, &select_time); if (FD_ISSET(listen_device.socket, &rfds)) { receive_slave_results() ; } // end of FD_ISSET(&listen_device.socket) /**
  • Receive results from child */ while (tc_listen(&data_listen_device)) { tc_accept(&data_listen_device, &data_connection_device); /**