- pair<int, int> mark_range(from, to);
- if (mark_pools->count(mark_range) != 0) {
- return (*mark_pools)[mark_range];
- }
-
- // Check if we're overlapping some other mark pool.
- for (map<pair<int, int>, MarkPool *>::const_iterator mp_it = mark_pools->begin();
- mp_it != mark_pools->end();
- ++mp_it) {
- int other_from = mp_it->first.first;
- int other_to = mp_it->first.second;
- if ((from >= other_from && from < other_to) ||
- (to >= other_from && to < other_to)) {
- fprintf(stderr, "WARNING: Mark pool %d-%d partially overlaps with %d-%d, you may get duplicate marks.\n",
- from, to, other_from, other_to);
- fprintf(stderr, " Mark pools must either be completely disjunct, or completely overlapping.\n");
+ vector<Acceptor *> acceptors;
+ for (unsigned i = 0; i < config.acceptors.size(); ++i) {
+ const AcceptorConfig &acceptor_config = config.acceptors[i];
+ Acceptor *acceptor = NULL;
+ map<int, Acceptor *>::iterator deserialized_acceptor_it =
+ deserialized_acceptors->find(acceptor_config.port);
+ if (deserialized_acceptor_it != deserialized_acceptors->end()) {
+ acceptor = deserialized_acceptor_it->second;
+ deserialized_acceptors->erase(deserialized_acceptor_it);
+ } else {
+ int server_sock = create_server_socket(acceptor_config.port, TCP_SOCKET);
+ acceptor = new Acceptor(server_sock, acceptor_config.port);