diff options
Diffstat (limited to 'src/Core')
-rw-r--r-- | src/Core/ConnectionManager.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp index 48d9c17..b9903c9 100644 --- a/src/Core/ConnectionManager.cpp +++ b/src/Core/ConnectionManager.cpp @@ -51,14 +51,24 @@ void ConnectionManager::refreshPollfds() { } ConnectionManager::ConnectionManager(const std::vector<Net::IPAddress> &listenerAddresses) { - for(std::vector<Net::IPAddress>::const_iterator address = listenerAddresses.begin(); address != listenerAddresses.end(); ++address) { + if(listenerAddresses.empty()) { try { - listeners.push_back(new Net::Listener(*address)); + listeners.push_back(new Net::Listener()); } catch(Net::Exception &e) { // TODO: Log error } } + else { + for(std::vector<Net::IPAddress>::const_iterator address = listenerAddresses.begin(); address != listenerAddresses.end(); ++address) { + try { + listeners.push_back(new Net::Listener(*address)); + } + catch(Net::Exception &e) { + // TODO: Log error + } + } + } refreshPollfds(); } |