Project

General

Profile

Revision 661

Added by Jason knichel about 16 years ago

virtual wall reported to robots

View differences:

ColonetServer.cpp
27 27
#define LISTEN_BACKLOG 5
28 28
#define LOG_BUFFER_LENGTH 128
29 29
#define MAX_MSG_BUFFER_LENGTH 128
30
#define REFRESH_VIRTUAL_WALL_PERIOD 400
30 31

  
31 32
#define u_int32_t unsigned
32 33

  
......
128 129
    logger->log_message("Server initialized.  About to start listening for connections");
129 130
  }
130 131

  
132
  int refresh_virtual_wall_count = 0;
133

  
131 134
  while(1) {
132 135
    //sleep for a little bit so this program doesn't hog cpu
133 136
    usleep(10000);
134 137

  
138
    /* Refresh virtual wall. */
139
    if (refresh_virtual_wall_count == REFRESH_VIRTUAL_WALL_PERIOD) {
140
      fprintf(stderr, "Sending virtual wall info to robots.\n");
141
      refresh_virtual_wall_count = 0;
142
      virtual_wall.send_to_robots();
143
    }
144
    refresh_virtual_wall_count++;
145

  
135 146
    //tell the connection pool to look at the file descriptors and see which ones are ready
136 147
    connection_pool->perform_select(listen_socket);
137 148

  
......
179 190
    //check all the clients in the connection pool
180 191
    if (connection_pool->check_clients() < 0) {
181 192
      printf("\tThere was an error trying to update the clients.");
182
      continue;
183 193
    }
184 194
  }
185 195

  

Also available in: Unified diff