record workers in a map instead of a vector
This commit is contained in:
parent
a39278f7be
commit
58a68ec0be
@ -114,7 +114,7 @@ namespace ix
|
||||
continue;
|
||||
}
|
||||
|
||||
_workers.push_back(std::thread(&WebSocketServer::handleConnection, this, clientFd));
|
||||
_workers[clientFd] = std::thread(&WebSocketServer::handleConnection, this, clientFd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <utility> // pair
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
@ -39,7 +39,6 @@ namespace ix
|
||||
// socket for accepting connections
|
||||
int _serverFd;
|
||||
|
||||
// FIXME: we never reclaim space in this array ...
|
||||
std::vector<std::thread> _workers;
|
||||
std::map<int, std::thread> _workers;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user