Project

General

Profile

Revision 79

Added by Chris Mar over 16 years ago

tried to merge lib_additions again...

View differences:

ColonetServer.cpp
23 23
#include "includes/ConnectionPool.h"
24 24
#include "includes/client.h"
25 25
#include "includes/options.h"
26
#include "includes/Logging.h"
26
#include "includes/Log.h"
27 27

  
28 28
#define LISTEN_BACKLOG 5
29 29
#define LOG_BUFFER_LENGTH 128
......
109 109
    int accept_socket = 0;
110 110
    struct sockaddr_in client_addr;
111 111
    socklen_t client_addr_size = sizeof(client_addr);
112
    struct timeval select_timeout;
113
    
114
    memset(&select_timeout, 0, sizeof(select_timeout));
115 112

  
116 113
    log_message("Server initialized.  About to start listening for connections");
117 114

  
118 115
    while(1) {
119
      connection_pool.perform_select(listen_socket, &select_timeout);
116
      connection_pool.perform_select(listen_socket);
120 117

  
121 118
      //either no descriptors are ready or there was an error
122
      //TODO: check for specific errors
123 119
      if (connection_pool.get_number_clients_ready() <= 0) {
124 120
        continue;
125 121
      }
......
133 129
                   "  Dropping the new connection.\n");
134 130
            continue;
135 131
          } else {
136
            printf("\tThere was an error when attempting to accept a "
137
                   "connection");
132
            printf("\tThere was an error when attempting to accept a connection");
138 133
          }
139 134
          continue;
140 135
        }

Also available in: Unified diff