Revision 134
removed more dead code
trunk/code/projects/colonet/ColonetServer/includes/ConnectionPool.h | ||
---|---|---|
35 | 35 |
ConnectionPool(); |
36 | 36 |
~ConnectionPool(); |
37 | 37 |
|
38 |
//TODO: restructure the class to get rid of exposing so much stuff |
|
39 |
|
|
38 | 40 |
int add_client(int client_file_descriptor); |
39 | 41 |
int remove_client(int pool_index); |
40 | 42 |
int check_clients(); |
... | ... | |
42 | 44 |
void set_listen_socket_in_ready_set(int listen_socket); |
43 | 45 |
int perform_select(int listen_socket); |
44 | 46 |
int is_socket_ready_to_read(int socket); |
45 |
int is_socket_ready_to_write(int socket); |
|
46 | 47 |
|
47 |
|
|
48 | 48 |
int get_max_file_descriptor(); |
49 | 49 |
void set_max_file_descriptor(int new_max_file_descriptor); |
50 | 50 |
|
51 |
int get_next_available_slot(); |
|
52 |
|
|
53 | 51 |
int get_number_clients_ready(); |
54 |
void set_number_clients_ready(int new_number_clients_ready); |
|
55 | 52 |
|
56 |
fd_set get_ready_set(); |
|
57 |
|
|
58 |
fd_set get_read_set(); |
|
59 |
void set_read_set(fd_set new_set); |
|
60 |
|
|
61 |
fd_set get_write_set(); |
|
62 |
void set_write_set(fd_set new_set); |
|
63 |
|
|
64 | 53 |
private: |
65 | 54 |
int max_file_descriptor; |
66 | 55 |
int next_available_slot; |
trunk/code/projects/colonet/ColonetServer/ConnectionPool.cpp | ||
---|---|---|
332 | 332 |
return FD_ISSET(socket, &read_set); |
333 | 333 |
} |
334 | 334 |
|
335 |
int ConnectionPool::is_socket_ready_to_write(int socket) { |
|
336 |
return FD_ISSET(socket, &write_set); |
|
337 |
} |
|
338 |
|
|
339 | 335 |
int ConnectionPool::get_max_file_descriptor() { |
340 | 336 |
return max_file_descriptor; |
341 | 337 |
} |
... | ... | |
344 | 340 |
max_file_descriptor = new_max_file_descriptor; |
345 | 341 |
} |
346 | 342 |
|
347 |
int ConnectionPool::get_next_available_slot() { |
|
348 |
return next_available_slot; |
|
349 |
} |
|
350 |
|
|
351 | 343 |
int ConnectionPool::get_number_clients_ready() { |
352 | 344 |
return number_clients_ready; |
353 | 345 |
} |
354 | 346 |
|
355 |
void ConnectionPool::set_number_clients_ready(int new_number_clients_ready) { |
|
356 |
number_clients_ready = new_number_clients_ready; |
|
357 |
} |
|
358 | 347 |
|
359 |
fd_set ConnectionPool::get_ready_set() { |
|
360 |
return ready_set; |
|
361 |
} |
|
362 |
|
|
363 |
fd_set ConnectionPool::get_read_set() { |
|
364 |
return read_set; |
|
365 |
} |
|
366 |
|
|
367 |
void ConnectionPool::set_read_set(fd_set new_set) { |
|
368 |
read_set = new_set; |
|
369 |
} |
|
370 |
|
|
371 |
fd_set ConnectionPool::get_write_set() { |
|
372 |
return write_set; |
|
373 |
} |
|
374 |
|
|
375 |
void ConnectionPool::set_write_set(fd_set new_set) { |
|
376 |
write_set = new_set; |
|
377 |
} |
|
378 |
|
|
379 |
|
Also available in: Unified diff