Project

General

Profile

Revision 143

Added by Jason knichel over 16 years ago

improved the data encapsulation of connection pool

View differences:

ConnectionPool.cpp
292 292
 *
293 293
 * @return void
294 294
 */
295
void ConnectionPool::set_listen_socket_in_ready_set(int listen_socket) {
296
  if (listen_socket < 0)
295
void ConnectionPool::add_new_socket_to_pool(int new_socket) {
296
  if (new_socket < 0)
297 297
    return;
298 298

  
299
  FD_SET(listen_socket, &ready_set);
299
  FD_SET(new_socket, &ready_set);
300

  
301
  if (new_socket > max_file_descriptor) {
302
    max_file_descriptor = new_socket;
303
  }
300 304
}
301 305

  
302 306
/**
......
331 335
  return FD_ISSET(socket, &read_set);
332 336
}
333 337

  
334
int ConnectionPool::get_max_file_descriptor() {
335
  return max_file_descriptor;
336
}
337

  
338
void ConnectionPool::set_max_file_descriptor(int new_max_file_descriptor) {
339
  max_file_descriptor = new_max_file_descriptor;
340
}
341

  
342 338
int ConnectionPool::get_number_clients_ready() {
343 339
  return number_clients_ready;
344 340
}

Also available in: Unified diff