void Server::update() { if (m_state != STARTED) { printf("Trying to call update() while the server isn't ready. STATE was %d\n", m_state); return; } printf("Server updating with %d clients\n", m_clients.size()); if (m_clients.size() < s_max_clients) { check_for_new_connections(); } check_for_new_data(); }
/** * Linux specific setup * * (1) Open device files * (2) Get initial data * (3) Set up terminal **/ void gp2021_init (void) { /* open device files */ if ((fd_status = open ("/dev/gps/status", O_RDWR)) == -1) perror ("open of GPS status device"); if ((fd_measurement = open ("/dev/gps/measurement", O_RDWR)) == -1) perror ("open of GPS measurement device"); if ((fd_data = open ("/dev/gps/data", O_RDONLY)) == -1) perror ("open of GPS data message device"); if ((fd_status == -1) || (fd_measurement == -1) || (fd_data == -1)) exit (EXIT_FAILURE); check_for_new_data (); setup_term (); }
void hci_timer_proc() { int redraw_flag = -1; /* Check for busy flags from gui tasks. */ check_for_busy_flags(); /* Make sure latest radial info event is available. */ hci_set_latest_radial_info(); /* Check for new data. */ check_for_new_data(); /* Check for conditions that warrant an erase and forced redraw of the control panel. */ redraw_flag = get_redraw_flag(); /* If a forced redraw is needed, erase the control panel first. */ if( redraw_flag == FORCE_REDRAW ) { hci_control_panel_erase(); } /* Draw control panel. */ hci_control_panel_draw( redraw_flag ); /* Destroy progress meter. */ if( progress_meter_first_time ) { progress_meter_first_time = 0; } }