Revision 409
reduced colonet server cpu usage to near zero
ColonetServer.cpp | ||
---|---|---|
13 | 13 |
#include <errno.h> |
14 | 14 |
#include <netinet/in.h> |
15 | 15 |
#include <string.h> |
16 |
#include <unistd.h> |
|
16 | 17 |
#include <sys/select.h> |
17 | 18 |
#include <sys/socket.h> |
18 | 19 |
|
... | ... | |
95 | 96 |
logger.log_message("Server initialized. About to start listening for connections"); |
96 | 97 |
|
97 | 98 |
while(1) { |
99 |
usleep(10000); |
|
100 |
|
|
98 | 101 |
connection_pool.perform_select(listen_socket); |
99 | 102 |
|
100 | 103 |
//either no descriptors are ready or there was an error |
Also available in: Unified diff